home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / NoteAttributeDialog.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  85.1 KB  |  2,486 lines  |  [TEXT/KAHL]

  1. /* NoteAttributeDialog.c */
  2. /*****************************************************************************/
  3. /*                                                                           */
  4. /*    Out Of Phase:  Digital Music Synthesis on General Purpose Computers    */
  5. /*    Copyright (C) 1994  Thomas R. Lawrence                                 */
  6. /*                                                                           */
  7. /*    This program is free software; you can redistribute it and/or modify   */
  8. /*    it under the terms of the GNU General Public License as published by   */
  9. /*    the Free Software Foundation; either version 2 of the License, or      */
  10. /*    (at your option) any later version.                                    */
  11. /*                                                                           */
  12. /*    This program is distributed in the hope that it will be useful,        */
  13. /*    but WITHOUT ANY WARRANTY; without even the implied warranty of         */
  14. /*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          */
  15. /*    GNU General Public License for more details.                           */
  16. /*                                                                           */
  17. /*    You should have received a copy of the GNU General Public License      */
  18. /*    along with this program; if not, write to the Free Software            */
  19. /*    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.              */
  20. /*                                                                           */
  21. /*    Thomas R. Lawrence can be reached at tomlaw@world.std.com.             */
  22. /*                                                                           */
  23. /*****************************************************************************/
  24.  
  25. #include "MiscInfo.h"
  26. #include "Audit.h"
  27. #include "Debug.h"
  28. #include "Definitions.h"
  29.  
  30. #include "NoteAttributeDialog.h"
  31. #include "Memory.h"
  32. #include "NoteObject.h"
  33. #include "Screen.h"
  34. #include "Main.h"
  35. #include "Menus.h"
  36. #include "EventLoop.h"
  37. #include "SimpleButton.h"
  38. #include "TextEdit.h"
  39. #include "RadioButton.h"
  40. #include "Alert.h"
  41. #include "Numbers.h"
  42. #include "WrapTextBox.h"
  43. #include "SymbolicDuration.h"
  44. #include "SymbolicPitch.h"
  45. #include "DataMunging.h"
  46. #include "SymbolicIsItInThere.h"
  47. #include "CheckBox.h"
  48. #include "TrackObject.h"
  49.  
  50.  
  51. #define WINXSIZE (500)
  52.  
  53. #define INDENTVALUE (80)
  54.  
  55. #define BUTTON1WIDTH (50)
  56. #define BUTTON2WIDTH (70)
  57. #define BUTTON3WIDTH (60)
  58.  
  59. #define DESCRIPTIONX (10)
  60. #define DESCRIPTIONY (6)
  61. #define DESCRIPTIONWIDTH (WINXSIZE - DESCRIPTIONX - DESCRIPTIONX)
  62. #define DESCRIPTIONHEIGHT (15)
  63.  
  64. #define EARLYLATEADJUSTPROMPTX (DESCRIPTIONX)
  65. #define EARLYLATEADJUSTPROMPTY (DESCRIPTIONY + DESCRIPTIONHEIGHT + 3 + 5)
  66.  
  67. #define EARLYLATEADJUSTEDITX (EARLYLATEADJUSTPROMPTX + INDENTVALUE)
  68. #define EARLYLATEADJUSTEDITY (EARLYLATEADJUSTPROMPTY - 3)
  69. #define EARLYLATEADJUSTEDITWIDTH (70)
  70. #define EARLYLATEADJUSTEDITHEIGHT (19)
  71.  
  72. #define RELEASE1PROMPTX (EARLYLATEADJUSTEDITX + EARLYLATEADJUSTEDITWIDTH + 10)
  73. #define RELEASE1PROMPTY (EARLYLATEADJUSTPROMPTY)
  74.  
  75. #define RELEASE1EDITX (RELEASE1PROMPTX + INDENTVALUE)
  76. #define RELEASE1EDITY (RELEASE1PROMPTY - 3)
  77. #define RELEASE1EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  78. #define RELEASE1EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  79.  
  80. #define RELEASE1STARTBUTTONX (RELEASE1EDITX + RELEASE1EDITWIDTH + 5)
  81. #define RELEASE1STARTBUTTONY (RELEASE1EDITY)
  82. #define RELEASE1STARTBUTTONWIDTH (BUTTON1WIDTH)
  83. #define RELEASE1STARTBUTTONHEIGHT (RELEASE1EDITHEIGHT)
  84.  
  85. #define RELEASE1ENDBUTTONX (RELEASE1STARTBUTTONX + RELEASE1STARTBUTTONWIDTH)
  86. #define RELEASE1ENDBUTTONY (RELEASE1STARTBUTTONY)
  87. #define RELEASE1ENDBUTTONWIDTH (BUTTON2WIDTH)
  88. #define RELEASE1ENDBUTTONHEIGHT (RELEASE1STARTBUTTONHEIGHT)
  89.  
  90. #define RELEASE1DEFAULTBUTTONX (RELEASE1ENDBUTTONX + RELEASE1ENDBUTTONWIDTH)
  91. #define RELEASE1DEFAULTBUTTONY (RELEASE1ENDBUTTONY)
  92. #define RELEASE1DEFAULTBUTTONWIDTH (BUTTON3WIDTH)
  93. #define RELEASE1DEFAULTBUTTONHEIGHT (RELEASE1ENDBUTTONHEIGHT)
  94.  
  95. #define LOUDNESSPROMPTX (EARLYLATEADJUSTPROMPTX)
  96. #define LOUDNESSPROMPTY (EARLYLATEADJUSTPROMPTY + EARLYLATEADJUSTEDITHEIGHT - 1)
  97.  
  98. #define LOUDNESSEDITX (LOUDNESSPROMPTX + INDENTVALUE)
  99. #define LOUDNESSEDITY (LOUDNESSPROMPTY - 3)
  100. #define LOUDNESSEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  101. #define LOUDNESSEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  102.  
  103. #define RELEASE2PROMPTX (LOUDNESSEDITX + LOUDNESSEDITWIDTH + 10)
  104. #define RELEASE2PROMPTY (LOUDNESSPROMPTY)
  105.  
  106. #define RELEASE2EDITX (RELEASE2PROMPTX + INDENTVALUE)
  107. #define RELEASE2EDITY (RELEASE2PROMPTY - 3)
  108. #define RELEASE2EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  109. #define RELEASE2EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  110.  
  111. #define RELEASE2STARTBUTTONX (RELEASE2EDITX + RELEASE2EDITWIDTH + 5)
  112. #define RELEASE2STARTBUTTONY (RELEASE2EDITY)
  113. #define RELEASE2STARTBUTTONWIDTH (BUTTON1WIDTH)
  114. #define RELEASE2STARTBUTTONHEIGHT (RELEASE2EDITHEIGHT)
  115.  
  116. #define RELEASE2ENDBUTTONX (RELEASE2STARTBUTTONX + RELEASE2STARTBUTTONWIDTH)
  117. #define RELEASE2ENDBUTTONY (RELEASE2STARTBUTTONY)
  118. #define RELEASE2ENDBUTTONWIDTH (BUTTON2WIDTH)
  119. #define RELEASE2ENDBUTTONHEIGHT (RELEASE2STARTBUTTONHEIGHT)
  120.  
  121. #define RELEASE2DEFAULTBUTTONX (RELEASE2ENDBUTTONX + RELEASE2ENDBUTTONWIDTH)
  122. #define RELEASE2DEFAULTBUTTONY (RELEASE2ENDBUTTONY)
  123. #define RELEASE2DEFAULTBUTTONWIDTH (BUTTON3WIDTH)
  124. #define RELEASE2DEFAULTBUTTONHEIGHT (RELEASE2ENDBUTTONHEIGHT)
  125.  
  126. #define ACCENT1PROMPTX (EARLYLATEADJUSTPROMPTX)
  127. #define ACCENT1PROMPTY (LOUDNESSPROMPTY + LOUDNESSEDITHEIGHT - 1)
  128.  
  129. #define ACCENT1EDITX (ACCENT1PROMPTX + INDENTVALUE)
  130. #define ACCENT1EDITY (ACCENT1PROMPTY - 3)
  131. #define ACCENT1EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  132. #define ACCENT1EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  133.  
  134. #define ACCENT2PROMPTX (ACCENT1EDITX + ACCENT1EDITWIDTH + 10)
  135. #define ACCENT2PROMPTY (ACCENT1PROMPTY)
  136.  
  137. #define ACCENT2EDITX (ACCENT2PROMPTX + INDENTVALUE)
  138. #define ACCENT2EDITY (ACCENT2PROMPTY - 3)
  139. #define ACCENT2EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  140. #define ACCENT2EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  141.  
  142. #define ACCENT3PROMPTX (EARLYLATEADJUSTPROMPTX)
  143. #define ACCENT3PROMPTY (ACCENT1PROMPTY + ACCENT1EDITHEIGHT - 1)
  144.  
  145. #define ACCENT3EDITX (ACCENT3PROMPTX + INDENTVALUE)
  146. #define ACCENT3EDITY (ACCENT3PROMPTY - 3)
  147. #define ACCENT3EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  148. #define ACCENT3EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  149.  
  150. #define ACCENT4PROMPTX (ACCENT3EDITX + ACCENT3EDITWIDTH + 10)
  151. #define ACCENT4PROMPTY (ACCENT3PROMPTY)
  152.  
  153. #define ACCENT4EDITX (ACCENT4PROMPTX + INDENTVALUE)
  154. #define ACCENT4EDITY (ACCENT4PROMPTY - 3)
  155. #define ACCENT4EDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  156. #define ACCENT4EDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  157.  
  158. #define PITCHDISPRATEPROMPTX (EARLYLATEADJUSTPROMPTX)
  159. #define PITCHDISPRATEPROMPTY (ACCENT3PROMPTY + ACCENT3EDITHEIGHT - 1)
  160.  
  161. #define PITCHDISPRATEEDITX (PITCHDISPRATEPROMPTX + INDENTVALUE)
  162. #define PITCHDISPRATEEDITY (PITCHDISPRATEPROMPTY - 3)
  163. #define PITCHDISPRATEEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  164. #define PTICHDISPRATEEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  165.  
  166. #define PITCHDISPDEPTHPROMPTX (PITCHDISPRATEEDITX + PITCHDISPRATEEDITWIDTH + 10)
  167. #define PITCHDISPDEPTHPROMPTY (PITCHDISPRATEPROMPTY)
  168.  
  169. #define PITCHDISPDEPTHEDITX (PITCHDISPDEPTHPROMPTX + INDENTVALUE)
  170. #define PITCHDISPDEPTHEDITY (PITCHDISPDEPTHPROMPTY - 3)
  171. #define PITCHDISPDEPTHEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  172. #define PITCHDISPDEPTHEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  173.  
  174. #define PITCHDISPDEPTHHERTZBUTTONX (PITCHDISPDEPTHEDITX + PITCHDISPDEPTHEDITWIDTH + 5)
  175. #define PITCHDISPDEPTHHERTZBUTTONY (PITCHDISPDEPTHEDITY)
  176. #define PITCHDISPDEPTHHERTZBUTTONWIDTH (BUTTON1WIDTH)
  177. #define PITCHDISPDEPTHHERTZBUTTONHEIGHT (PITCHDISPDEPTHEDITHEIGHT)
  178.  
  179. #define PITCHDISPDEPTHHALFSTEPBUTTONX (PITCHDISPDEPTHHERTZBUTTONX\
  180.                     + PITCHDISPDEPTHHERTZBUTTONWIDTH)
  181. #define PITCHDISPDEPTHHALFSTEPBUTTONY (PITCHDISPDEPTHHERTZBUTTONY)
  182. #define PITCHDISPDEPTHHALFSTEPBUTTONWIDTH (BUTTON2WIDTH)
  183. #define PITCHDISPDEPTHHALFSTEPBUTTONHEIGHT (PITCHDISPDEPTHHERTZBUTTONHEIGHT)
  184.  
  185. #define PITCHDISPDEPTHDEFAULTBUTTONX (PITCHDISPDEPTHHALFSTEPBUTTONX\
  186.                     + PITCHDISPDEPTHHALFSTEPBUTTONWIDTH)
  187. #define PITCHDISPDEPTHDEFAULTBUTTONY (PITCHDISPDEPTHHALFSTEPBUTTONY)
  188. #define PITCHDISPDEPTHDEFAULTBUTTONWIDTH (BUTTON3WIDTH)
  189. #define PITCHDISPDEPTHDEFAULTBUTTONHEIGHT (PITCHDISPDEPTHHALFSTEPBUTTONHEIGHT)
  190.  
  191. #define HURRYUPPROMPTX (EARLYLATEADJUSTPROMPTX)
  192. #define HURRYUPPROMPTY (PITCHDISPRATEPROMPTY + PTICHDISPRATEEDITHEIGHT - 1)
  193.  
  194. #define HURRYUPEDITX (HURRYUPPROMPTX + INDENTVALUE)
  195. #define HURRYUPEDITY (HURRYUPPROMPTY - 3)
  196. #define HURRYUPEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  197. #define HURRYUPEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  198.  
  199. #define PITCHDISPSTARTPROMPTX (HURRYUPEDITX + HURRYUPEDITWIDTH + 10)
  200. #define PITCHDISPSTARTPROMPTY (HURRYUPPROMPTY)
  201.  
  202. #define PITCHDISPSTARTEDITX (PITCHDISPSTARTPROMPTX + INDENTVALUE)
  203. #define PITCHDISPSTARTEDITY (PITCHDISPSTARTPROMPTY - 3)
  204. #define PITCHDISPSTARTEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  205. #define PITCHDISPSTARTEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  206.  
  207. #define PITCHDISPSTARTSTARTBUTTONX (PITCHDISPSTARTEDITX + PITCHDISPSTARTEDITWIDTH + 5)
  208. #define PITCHDISPSTARTSTARTBUTTONY (PITCHDISPSTARTEDITY)
  209. #define PITCHDISPSTARTSTARTBUTTONWIDTH (BUTTON1WIDTH)
  210. #define PITCHDISPSTARTSTARTBUTTONHEIGHT (PITCHDISPSTARTEDITHEIGHT)
  211.  
  212. #define PITCHDISPSTARTENDBUTTONX (PITCHDISPSTARTSTARTBUTTONX\
  213.                     + PITCHDISPSTARTSTARTBUTTONWIDTH)
  214. #define PITCHDISPSTARTENDBUTTONY (PITCHDISPSTARTSTARTBUTTONY)
  215. #define PITCHDISPSTARTENDBUTTONWIDTH (BUTTON2WIDTH)
  216. #define PITCHDISPSTARTENDBUTTONHEIGHT (PITCHDISPSTARTSTARTBUTTONHEIGHT)
  217.  
  218. #define PITCHDISPSTARTDEFAULTBUTTONX (PITCHDISPSTARTENDBUTTONX\
  219.                     + PITCHDISPSTARTENDBUTTONWIDTH)
  220. #define PITCHDISPSTARTDEFAULTBUTTONY (PITCHDISPSTARTENDBUTTONY)
  221. #define PITCHDISPSTARTDEFAULTBUTTONWIDTH (BUTTON3WIDTH)
  222. #define PITCHDISPSTARTDEFAULTBUTTONHEIGHT (PITCHDISPSTARTENDBUTTONHEIGHT)
  223.  
  224. #define STEREOPOSPROMPTX (EARLYLATEADJUSTPROMPTX)
  225. #define STEREOPOSPROMPTY (HURRYUPPROMPTY + HURRYUPEDITHEIGHT - 1)
  226.  
  227. #define STEREOPOSEDITX (STEREOPOSPROMPTX + INDENTVALUE)
  228. #define STEREOPOSEDITY (STEREOPOSPROMPTY - 3)
  229. #define STEREOPOSEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  230. #define STEREOPOSEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  231.  
  232. #define DETUNEPROMPTX (STEREOPOSEDITX + STEREOPOSEDITWIDTH + 10)
  233. #define DETUNEPROMPTY (STEREOPOSPROMPTY)
  234.  
  235. #define DETUNEEDITX (DETUNEPROMPTX + INDENTVALUE)
  236. #define DETUNEEDITY (DETUNEPROMPTY - 3)
  237. #define DETUNEEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  238. #define DETUNEEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  239.  
  240. #define DETUNEHERTZBUTTONX (DETUNEEDITX + DETUNEEDITWIDTH + 5)
  241. #define DETUNEHERTZBUTTONY (DETUNEEDITY)
  242. #define DETUNEHERTZBUTTONWIDTH (BUTTON1WIDTH)
  243. #define DETUNEHERTZBUTTONHEIGHT (DETUNEEDITHEIGHT)
  244.  
  245. #define DETUNEHALFSTEPBUTTONX (DETUNEHERTZBUTTONX + DETUNEHERTZBUTTONWIDTH)
  246. #define DETUNEHALFSTEPBUTTONY (DETUNEHERTZBUTTONY)
  247. #define DETUNEHALFSTEPBUTTONWIDTH (BUTTON2WIDTH)
  248. #define DETUNEHALFSTEPBUTTONHEIGHT (DETUNEHERTZBUTTONHEIGHT)
  249.  
  250. #define DETUNEDEFAULTBUTTONX (DETUNEHALFSTEPBUTTONX + DETUNEHALFSTEPBUTTONWIDTH)
  251. #define DETUNEDEFAULTBUTTONY (DETUNEHALFSTEPBUTTONY)
  252. #define DETUNEDEFAULTBUTTONWIDTH (BUTTON3WIDTH)
  253. #define DETUNEDEFAULTBUTTONHEIGHT (DETUNEHALFSTEPBUTTONHEIGHT)
  254.  
  255. #define SURROUNDPOSPROMPTX (EARLYLATEADJUSTPROMPTX)
  256. #define SURROUNDPOSPROMPTY (STEREOPOSPROMPTY + STEREOPOSEDITHEIGHT - 1)
  257.  
  258. #define SURROUNDPOSEDITX (SURROUNDPOSPROMPTX + INDENTVALUE)
  259. #define SURROUNDPOSEDITY (SURROUNDPOSPROMPTY - 3)
  260. #define SURROUNDPOSEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  261. #define SURROUNDPOSEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  262.  
  263. #define DURATIONPROMPTX (EARLYLATEADJUSTPROMPTX)
  264. #define DURATIONPROMPTY (SURROUNDPOSPROMPTY + STEREOPOSEDITHEIGHT - 1)
  265.  
  266. #define DURATIONEDITX (DURATIONPROMPTX + INDENTVALUE)
  267. #define DURATIONEDITY (DURATIONPROMPTY - 3)
  268. #define DURATIONEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  269. #define DURATIONEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  270.  
  271. #define DURATIONADJUSTPROMPTX (DURATIONEDITX + DURATIONEDITWIDTH + 10)
  272. #define DURATIONADJUSTPROMPTY (DURATIONPROMPTY)
  273.  
  274. #define DURATIONADJUSTEDITX (DURATIONADJUSTPROMPTX + INDENTVALUE)
  275. #define DURATIONADJUSTEDITY (DURATIONADJUSTPROMPTY - 3)
  276. #define DURATIONADJUSTEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  277. #define DURATIONADJUSTEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  278.  
  279. #define DURATIONADJUSTADDBUTTONX (DURATIONADJUSTEDITX + DURATIONADJUSTEDITWIDTH + 5)
  280. #define DURATIONADJUSTADDBUTTONY (DURATIONADJUSTEDITY)
  281. #define DURATIONADJUSTADDBUTTONWIDTH (BUTTON1WIDTH)
  282. #define DURATIONADJUSTADDBUTTONHEIGHT (DURATIONADJUSTEDITHEIGHT)
  283.  
  284. #define DURATIONADJUSTMULTBUTTONX (DURATIONADJUSTADDBUTTONX\
  285.                     + DURATIONADJUSTADDBUTTONWIDTH)
  286. #define DURATIONADJUSTMULTBUTTONY (DURATIONADJUSTADDBUTTONY)
  287. #define DURATIONADJUSTMULTBUTTONWIDTH (BUTTON2WIDTH)
  288. #define DURATIONADJUSTMULTBOTTONHEIGHT (DURATIONADJUSTADDBUTTONHEIGHT)
  289.  
  290. #define DURATIONADJUSTDEFAULTBUTTONX (DURATIONADJUSTMULTBUTTONX\
  291.                     + DURATIONADJUSTMULTBUTTONWIDTH)
  292. #define DURATIONADJUSTDEFAULTBUTTONY (DURATIONADJUSTMULTBUTTONY)
  293. #define DURATIONADJUSTDEFAULTBUTTONWIDTH (BUTTON3WIDTH)
  294. #define DURATIONADJUSTDEFAULTBUTTONHEIGHT (DURATIONADJUSTMULTBOTTONHEIGHT)
  295.  
  296. #define REALPITCHPROMPTX (EARLYLATEADJUSTPROMPTX)
  297. #define REALPITCHPROMPTY (DURATIONPROMPTY + DURATIONEDITHEIGHT - 1)
  298.  
  299. #define REALPITCHEDITX (REALPITCHPROMPTX + INDENTVALUE)
  300. #define REALPITCHEDITY (REALPITCHPROMPTY - 3)
  301. #define REALPITCHEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  302. #define REALPITCHEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  303.  
  304. #define FAKEPITCHPROMPTX (REALPITCHEDITX + REALPITCHEDITWIDTH + 10)
  305. #define FAKEPITCHPROMPTY (REALPITCHPROMPTY)
  306.  
  307. #define FAKEPITCHEDITX (FAKEPITCHPROMPTX + INDENTVALUE)
  308. #define FAKEPITCHEDITY (FAKEPITCHPROMPTY - 3)
  309. #define FAKEPITCHEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  310. #define FAKEPITCHEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  311.  
  312. #define PORTAMENTOPROMPTX (FAKEPITCHPROMPTX)
  313. #define PORTAMENTOPROMPTY (FAKEPITCHPROMPTY + REALPITCHEDITHEIGHT - 1)
  314.  
  315. #define PORTAMENTOEDITX (PORTAMENTOPROMPTX + INDENTVALUE)
  316. #define PORTAMENTOEDITY (PORTAMENTOPROMPTY - 3)
  317. #define PORTAMENTOEDITWIDTH (EARLYLATEADJUSTEDITWIDTH)
  318. #define PORTAMENTOEDITHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  319.  
  320. #define PORTAHERTZBUTTONX (PORTAMENTOEDITX + PORTAMENTOEDITWIDTH + 5)
  321. #define PORTAHERTZBUTTONY (PORTAMENTOEDITY)
  322. #define PORTAHERTZBUTTONWIDTH (BUTTON1WIDTH)
  323. #define PORTAHERTZBUTTONHEIGHT (PORTAMENTOEDITHEIGHT)
  324.  
  325. #define PORTAHALFSTEPBUTTONX (PORTAHERTZBUTTONX + PORTAHERTZBUTTONWIDTH)
  326. #define PORTAHALFSTEPBUTTONY (PORTAHERTZBUTTONY)
  327. #define PORTAHALFSTEPBUTTONWIDTH (BUTTON2WIDTH)
  328. #define PORTAHALFSTEPBUTTONHEIGHT (PORTAHERTZBUTTONHEIGHT)
  329.  
  330. #define RESTCHECKBOXX (EARLYLATEADJUSTPROMPTX)
  331. #define RESTCHECKBOXY (PORTAMENTOPROMPTY - 3)
  332. #define RESTCHECKBOXWIDTH (INDENTVALUE + EARLYLATEADJUSTEDITWIDTH)
  333. #define RESTCHECKBOXHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  334.  
  335. #define RETRIGCHECKBOXX (EARLYLATEADJUSTPROMPTX)
  336. #define RETRIGCHECKBOXY (RESTCHECKBOXY + EARLYLATEADJUSTEDITHEIGHT - 1)
  337. #define RETRIGCHECKBOXWIDTH (RESTCHECKBOXWIDTH)
  338. #define RETRIGCHECKBOXHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  339.  
  340. #define RELEASE3CHECKBOXX (RETRIGCHECKBOXX + INDENTVALUE + EARLYLATEADJUSTEDITWIDTH + 10)
  341. #define RELEASE3CHECKBOXY (RETRIGCHECKBOXY)
  342. #define RELEASE3CHECKBOXWIDTH (RESTCHECKBOXWIDTH)
  343. #define RELEASE3CHECKBOXHEIGHT (EARLYLATEADJUSTEDITHEIGHT)
  344.  
  345. #define OKBUTTONWIDTH (80)
  346. #define OKBUTTONHEIGHT (21)
  347. #define OKBUTTONY (RETRIGCHECKBOXY + RETRIGCHECKBOXHEIGHT + 15)
  348. #define OKBUTTONX ((WINXSIZE / 4) - (OKBUTTONWIDTH / 2))
  349.  
  350. #define CANCELBUTTONWIDTH (OKBUTTONWIDTH)
  351. #define CANCELBUTTONHEIGHT (OKBUTTONHEIGHT)
  352. #define CANCELBUTTONY (OKBUTTONY)
  353. #define CANCELBUTTONX (((3 * WINXSIZE) / 4) - (OKBUTTONWIDTH / 2))
  354.  
  355. #define WINYSIZE (CANCELBUTTONY + CANCELBUTTONHEIGHT + 10)
  356.  
  357.  
  358. typedef struct
  359.     {
  360.         WinType*                        ScreenID;
  361.         SimpleButtonRec*        OKButton;
  362.         SimpleButtonRec*        CancelButton;
  363.         TextEditRec*                EarlyLateEdit;
  364.         TextEditRec*                Release1Edit;
  365.         RadioButtonRec*            Release1StartButton;
  366.         RadioButtonRec*            Release1EndButton;
  367.         RadioButtonRec*            Release1DefaultButton;
  368.         TextEditRec*                LoudnessEdit;
  369.         TextEditRec*                Release2Edit;
  370.         RadioButtonRec*            Release2StartButton;
  371.         RadioButtonRec*            Release2EndButton;
  372.         RadioButtonRec*            Release2DefaultButton;
  373.         TextEditRec*                Accent1Edit;
  374.         TextEditRec*                Accent2Edit;
  375.         TextEditRec*                Accent3Edit;
  376.         TextEditRec*                Accent4Edit;
  377.         TextEditRec*                PitchDispRateEdit;
  378.         TextEditRec*                PitchDispDepthEdit;
  379.         RadioButtonRec*            PitchDispDepthHertzButton;
  380.         RadioButtonRec*            PitchDispDepthHalfStepButton;
  381.         RadioButtonRec*            PitchDispDepthDefaultButton;
  382.         TextEditRec*                HurryUpEdit;
  383.         TextEditRec*                PitchDispStartEdit;
  384.         RadioButtonRec*            PitchDispStartStartButton;
  385.         RadioButtonRec*            PitchDispStartEndButton;
  386.         RadioButtonRec*            PitchDispStartDefaultButton;
  387.         TextEditRec*                StereoPosEdit;
  388.         TextEditRec*                DetuneEdit;
  389.         RadioButtonRec*            DetuneHertzButton;
  390.         RadioButtonRec*            DetuneHalfstepButton;
  391.         RadioButtonRec*            DetuneDefaultButton;
  392.         TextEditRec*                SurroundPosEdit;
  393.         TextEditRec*                DurationEdit;
  394.         TextEditRec*                DurationAdjustEdit;
  395.         RadioButtonRec*            DurationAdjustAddButton;
  396.         RadioButtonRec*            DurationAdjustMultButton;
  397.         RadioButtonRec*            DurationAdjustDefaultButton;
  398.         TextEditRec*                RealPitchEdit;
  399.         TextEditRec*                FakePitchEdit;
  400.         TextEditRec*                PortamentoEdit;
  401.         CheckBoxRec*                RestBox;
  402.         RadioButtonRec*            PortaHertzButton;
  403.         RadioButtonRec*            PortaHalfstepButton;
  404.         CheckBoxRec*                RetrigBox;
  405.         CheckBoxRec*                Release3Box;
  406.     } WindowRec;
  407.  
  408.  
  409. static void                    UpdateTheWindow(WindowRec* Window)
  410.     {
  411.         CheckPtrExistence(Window);
  412.         RedrawSimpleButton(Window->OKButton);
  413.         RedrawSimpleButton(Window->CancelButton);
  414.         TextEditFullRedraw(Window->EarlyLateEdit);
  415.         TextEditFullRedraw(Window->Release1Edit);
  416.         RedrawRadioButton(Window->Release1StartButton);
  417.         RedrawRadioButton(Window->Release1EndButton);
  418.         RedrawRadioButton(Window->Release1DefaultButton);
  419.         TextEditFullRedraw(Window->LoudnessEdit);
  420.         TextEditFullRedraw(Window->Release2Edit);
  421.         RedrawRadioButton(Window->Release2StartButton);
  422.         RedrawRadioButton(Window->Release2EndButton);
  423.         RedrawRadioButton(Window->Release2DefaultButton);
  424.         TextEditFullRedraw(Window->Accent1Edit);
  425.         TextEditFullRedraw(Window->Accent2Edit);
  426.         TextEditFullRedraw(Window->Accent3Edit);
  427.         TextEditFullRedraw(Window->Accent4Edit);
  428.         TextEditFullRedraw(Window->PitchDispRateEdit);
  429.         TextEditFullRedraw(Window->PitchDispDepthEdit);
  430.         RedrawRadioButton(Window->PitchDispDepthHertzButton);
  431.         RedrawRadioButton(Window->PitchDispDepthHalfStepButton);
  432.         RedrawRadioButton(Window->PitchDispDepthDefaultButton);
  433.         TextEditFullRedraw(Window->HurryUpEdit);
  434.         TextEditFullRedraw(Window->PitchDispStartEdit);
  435.         RedrawRadioButton(Window->PitchDispStartStartButton);
  436.         RedrawRadioButton(Window->PitchDispStartEndButton);
  437.         RedrawRadioButton(Window->PitchDispStartDefaultButton);
  438.         TextEditFullRedraw(Window->StereoPosEdit);
  439.         TextEditFullRedraw(Window->DetuneEdit);
  440.         RedrawRadioButton(Window->DetuneHertzButton);
  441.         RedrawRadioButton(Window->DetuneHalfstepButton);
  442.         RedrawRadioButton(Window->DetuneDefaultButton);
  443.         TextEditFullRedraw(Window->SurroundPosEdit);
  444.         TextEditFullRedraw(Window->DurationEdit);
  445.         TextEditFullRedraw(Window->DurationAdjustEdit);
  446.         RedrawRadioButton(Window->DurationAdjustAddButton);
  447.         RedrawRadioButton(Window->DurationAdjustMultButton);
  448.         RedrawRadioButton(Window->DurationAdjustDefaultButton);
  449.         TextEditFullRedraw(Window->RealPitchEdit);
  450.         TextEditFullRedraw(Window->FakePitchEdit);
  451.         TextEditFullRedraw(Window->PortamentoEdit);
  452.         RedrawCheckBox(Window->RestBox);
  453.         RedrawRadioButton(Window->PortaHertzButton);
  454.         RedrawRadioButton(Window->PortaHalfstepButton);
  455.         RedrawCheckBox(Window->RetrigBox);
  456.         RedrawCheckBox(Window->Release3Box);
  457.         SetClipRect(Window->ScreenID,0,0,WINXSIZE,WINYSIZE);
  458.         DrawWrappedTextBox(Window->ScreenID,"Adjust the note's attributes:",
  459.             GetScreenFont(),9,DESCRIPTIONX,DESCRIPTIONY,DESCRIPTIONWIDTH,DESCRIPTIONHEIGHT);
  460.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Hit Time:",9,
  461.             EARLYLATEADJUSTPROMPTX,EARLYLATEADJUSTPROMPTY,ePlain);
  462.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Release 1:",10,
  463.             RELEASE1PROMPTX,RELEASE1PROMPTY,ePlain);
  464.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Loudness:",9,
  465.             LOUDNESSPROMPTX,LOUDNESSPROMPTY,ePlain);
  466.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Release 2:",10,
  467.             RELEASE2PROMPTX,RELEASE2PROMPTY,ePlain);
  468.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Accent 1:",9,
  469.             ACCENT1PROMPTX,ACCENT1PROMPTY,ePlain);
  470.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Accent 2:",9,
  471.             ACCENT2PROMPTX,ACCENT2PROMPTY,ePlain);
  472.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Accent 3:",9,
  473.             ACCENT3PROMPTX,ACCENT3PROMPTY,ePlain);
  474.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Accent 4:",9,
  475.             ACCENT4PROMPTX,ACCENT4PROMPTY,ePlain);
  476.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Pitch Disp Rate:",16,
  477.             PITCHDISPRATEPROMPTX,PITCHDISPRATEPROMPTY,ePlain);
  478.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Pitch Disp Depth:",17,
  479.             PITCHDISPDEPTHPROMPTX,PITCHDISPDEPTHPROMPTY,ePlain);
  480.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Hurry-Up:",9,
  481.             HURRYUPPROMPTX,HURRYUPPROMPTY,ePlain);
  482.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Pitch Disp Start:",17,
  483.             PITCHDISPSTARTPROMPTX,PITCHDISPSTARTPROMPTY,ePlain);
  484.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Stereo Pos:",11,
  485.             STEREOPOSPROMPTX,STEREOPOSPROMPTY,ePlain);
  486.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Detune:",7,
  487.             DETUNEPROMPTX,DETUNEPROMPTY,ePlain);
  488.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Surround Pos:",13,
  489.             SURROUNDPOSPROMPTX,SURROUNDPOSPROMPTY,ePlain);
  490.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Duration:",9,
  491.             DURATIONPROMPTX,DURATIONPROMPTY,ePlain);
  492.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Duration Adjust:",16,
  493.             DURATIONADJUSTPROMPTX,DURATIONADJUSTPROMPTY,ePlain);
  494.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Real Pitch:",11,
  495.             REALPITCHPROMPTX,REALPITCHPROMPTY,ePlain);
  496.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Effective Pitch:",16,
  497.             FAKEPITCHPROMPTX,FAKEPITCHPROMPTY,ePlain);
  498.         DrawTextLine(Window->ScreenID,GetScreenFont(),9,"Portamento:",11,
  499.             PORTAMENTOPROMPTX,PORTAMENTOPROMPTY,ePlain);
  500.     }
  501.  
  502.  
  503. /* show dialog box allowing user to edit note's parameters */
  504. void                        EditNoteParametersDialog(NoteObjectRec* Note, TrackObjectRec* Track)
  505.     {
  506.         WindowRec*                Window;
  507.         char*                            StringTemp;
  508.         MyBoolean                    LoopFlag;
  509.         TextEditRec*            ActiveTextEdit;
  510.         MyBoolean                    DoItFlag EXECUTE(= -31342);
  511.  
  512.         CheckPtrExistence(Note);
  513.  
  514.         Window = (WindowRec*)AllocPtrCanFail(sizeof(WindowRec),"TrackAttributeDialogWindow");
  515.         if (Window == NIL)
  516.             {
  517.              FailurePoint1:
  518.                 AlertHalt("There is not enough memory available to edit the note's attributes.",
  519.                     NIL);
  520.                 return;
  521.             }
  522.  
  523.         Window->ScreenID = MakeNewWindow(eModelessDialogWindow,eWindowNotClosable,
  524.             eWindowNotZoomable,eWindowNotResizable,DialogLeftEdge(WINXSIZE),
  525.             DialogTopEdge(WINYSIZE),WINXSIZE,WINYSIZE,(void (*)(void*))&UpdateTheWindow,Window);
  526.         if (Window->ScreenID == NIL)
  527.             {
  528.              FailurePoint2:
  529.                 ReleasePtr((char*)Window);
  530.                 goto FailurePoint1;
  531.             }
  532.         SetWindowName(Window->ScreenID,"Edit Note");
  533.  
  534.         Window->OKButton = NewSimpleButton(Window->ScreenID,"OK",OKBUTTONX,OKBUTTONY,
  535.             OKBUTTONWIDTH,OKBUTTONHEIGHT);
  536.         if (Window->OKButton == NIL)
  537.             {
  538.              FailurePoint3:
  539.                 KillWindow(Window->ScreenID);
  540.                 goto FailurePoint2;
  541.             }
  542.         SetDefaultButtonState(Window->OKButton,True);
  543.  
  544.         Window->CancelButton = NewSimpleButton(Window->ScreenID,"Cancel",CANCELBUTTONX,
  545.             CANCELBUTTONY,CANCELBUTTONWIDTH,CANCELBUTTONHEIGHT);
  546.         if (Window->CancelButton == NIL)
  547.             {
  548.              FailurePoint4:
  549.                 DisposeSimpleButton(Window->OKButton);
  550.                 goto FailurePoint3;
  551.             }
  552.  
  553.         Window->EarlyLateEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  554.             9,EARLYLATEADJUSTEDITX,EARLYLATEADJUSTEDITY,EARLYLATEADJUSTEDITWIDTH,
  555.             EARLYLATEADJUSTEDITHEIGHT);
  556.         if (Window->EarlyLateEdit == NIL)
  557.             {
  558.              FailurePoint5:
  559.                 DisposeSimpleButton(Window->CancelButton);
  560.                 goto FailurePoint4;
  561.             }
  562.         StringTemp = LongDoubleToString(GetNoteEarlyLateAdjust(Note),7,1e-4,1e6);
  563.         if (StringTemp == NIL)
  564.             {
  565.              FailurePoint6:
  566.                 DisposeTextEdit(Window->EarlyLateEdit);
  567.                 goto FailurePoint5;
  568.             }
  569.         TextEditNewRawData(Window->EarlyLateEdit,StringTemp,SYSTEMLINEFEED);
  570.         ReleasePtr(StringTemp);
  571.         TextEditHasBeenSaved(Window->EarlyLateEdit);
  572.  
  573.         Window->Release1Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  574.             9,RELEASE1EDITX,RELEASE1EDITY,RELEASE1EDITWIDTH,RELEASE1EDITHEIGHT);
  575.         if (Window->Release1Edit == NIL)
  576.             {
  577.              FailurePoint7:
  578.                 goto FailurePoint6;
  579.             }
  580.         StringTemp = LongDoubleToString(GetNoteReleasePoint1(Note),7,1e-4,1e6);
  581.         if (StringTemp == NIL)
  582.             {
  583.              FailurePoint8:
  584.                 DisposeTextEdit(Window->Release1Edit);
  585.                 goto FailurePoint7;
  586.             }
  587.         TextEditNewRawData(Window->Release1Edit,StringTemp,SYSTEMLINEFEED);
  588.         ReleasePtr(StringTemp);
  589.         TextEditHasBeenSaved(Window->Release1Edit);
  590.  
  591.         Window->Release1StartButton = NewRadioButton(Window->ScreenID,"Start",
  592.             RELEASE1STARTBUTTONX,RELEASE1STARTBUTTONY,RELEASE1STARTBUTTONWIDTH,
  593.             RELEASE1STARTBUTTONHEIGHT);
  594.         if (Window->Release1StartButton == NIL)
  595.             {
  596.              FailurePoint9:
  597.                 goto FailurePoint8;
  598.             }
  599.  
  600.         Window->Release1EndButton = NewRadioButton(Window->ScreenID,"End",
  601.             RELEASE1ENDBUTTONX,RELEASE1ENDBUTTONY,RELEASE1ENDBUTTONWIDTH,
  602.             RELEASE1ENDBUTTONHEIGHT);
  603.         if (Window->Release1EndButton == NIL)
  604.             {
  605.              FailurePoint10:
  606.                 DisposeRadioButton(Window->Release1StartButton);
  607.                 goto FailurePoint9;
  608.             }
  609.  
  610.         Window->Release1DefaultButton = NewRadioButton(Window->ScreenID,"Default",
  611.             RELEASE1DEFAULTBUTTONX,RELEASE1DEFAULTBUTTONY,RELEASE1DEFAULTBUTTONWIDTH,
  612.             RELEASE1DEFAULTBUTTONHEIGHT);
  613.         if (Window->Release1DefaultButton == NIL)
  614.             {
  615.              FailurePoint11:
  616.                 DisposeRadioButton(Window->Release1EndButton);
  617.                 goto FailurePoint10;
  618.             }
  619.  
  620.         switch (GetNoteRelease1Origin(Note))
  621.             {
  622.                 default:
  623.                     EXECUTE(PRERR(AllowResume,
  624.                         "EditNoteParametersDialog:  bad release point 1 start/end flag"));
  625.                     break;
  626.                 case eRelease1FromStart:
  627.                     SetRadioButtonState(Window->Release1StartButton,True);
  628.                     break;
  629.                 case eRelease1FromEnd:
  630.                     SetRadioButtonState(Window->Release1EndButton,True);
  631.                     break;
  632.                 case eRelease1FromDefault:
  633.                     SetRadioButtonState(Window->Release1DefaultButton,True);
  634.                     break;
  635.             }
  636.  
  637.         Window->LoudnessEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  638.             9,LOUDNESSEDITX,LOUDNESSEDITY,LOUDNESSEDITWIDTH,LOUDNESSEDITHEIGHT);
  639.         if (Window->LoudnessEdit == NIL)
  640.             {
  641.              FailurePoint12:
  642.                 DisposeRadioButton(Window->Release1DefaultButton);
  643.                 goto FailurePoint11;
  644.             }
  645.         StringTemp = LongDoubleToString(GetNoteOverallLoudnessAdjustment(Note),7,1e-4,1e6);
  646.         if (StringTemp == NIL)
  647.             {
  648.              FailurePoint13:
  649.                 DisposeTextEdit(Window->LoudnessEdit);
  650.                 goto FailurePoint12;
  651.             }
  652.         TextEditNewRawData(Window->LoudnessEdit,StringTemp,SYSTEMLINEFEED);
  653.         ReleasePtr(StringTemp);
  654.         TextEditHasBeenSaved(Window->LoudnessEdit);
  655.  
  656.         Window->Release2Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  657.             9,RELEASE2EDITX,RELEASE2EDITY,RELEASE2EDITWIDTH,RELEASE2EDITHEIGHT);
  658.         if (Window->Release2Edit == NIL)
  659.             {
  660.              FailurePoint14:
  661.                 goto FailurePoint13;
  662.             }
  663.         StringTemp = LongDoubleToString(GetNoteReleasePoint2(Note),7,1e-4,1e6);
  664.         if (StringTemp == NIL)
  665.             {
  666.              FailurePoint15:
  667.                 DisposeTextEdit(Window->Release2Edit);
  668.                 goto FailurePoint14;
  669.             }
  670.         TextEditNewRawData(Window->Release2Edit,StringTemp,SYSTEMLINEFEED);
  671.         ReleasePtr(StringTemp);
  672.         TextEditHasBeenSaved(Window->Release2Edit);
  673.  
  674.         Window->Release2StartButton = NewRadioButton(Window->ScreenID,"Start",
  675.             RELEASE2STARTBUTTONX,RELEASE2STARTBUTTONY,RELEASE2STARTBUTTONWIDTH,
  676.             RELEASE2STARTBUTTONHEIGHT);
  677.         if (Window->Release2StartButton == NIL)
  678.             {
  679.              FailurePoint16:
  680.                 goto FailurePoint15;
  681.             }
  682.  
  683.         Window->Release2EndButton = NewRadioButton(Window->ScreenID,"End",
  684.             RELEASE2ENDBUTTONX,RELEASE2ENDBUTTONY,RELEASE2ENDBUTTONWIDTH,
  685.             RELEASE2ENDBUTTONHEIGHT);
  686.         if (Window->Release2EndButton == NIL)
  687.             {
  688.              FailurePoint17:
  689.                 DisposeRadioButton(Window->Release2StartButton);
  690.                 goto FailurePoint16;
  691.             }
  692.  
  693.         Window->Release2DefaultButton = NewRadioButton(Window->ScreenID,"Default",
  694.             RELEASE2DEFAULTBUTTONX,RELEASE2DEFAULTBUTTONY,RELEASE2DEFAULTBUTTONWIDTH,
  695.             RELEASE2DEFAULTBUTTONHEIGHT);
  696.         if (Window->Release2DefaultButton == NIL)
  697.             {
  698.              FailurePoint18:
  699.                 DisposeRadioButton(Window->Release2EndButton);
  700.                 goto FailurePoint17;
  701.             }
  702.  
  703.         switch (GetNoteRelease2Origin(Note))
  704.             {
  705.                 default:
  706.                     EXECUTE(PRERR(AllowResume,
  707.                         "EditNoteParametersDialog:  bad release point 2 start/end flag"));
  708.                     break;
  709.                 case eRelease2FromStart:
  710.                     SetRadioButtonState(Window->Release2StartButton,True);
  711.                     break;
  712.                 case eRelease2FromEnd:
  713.                     SetRadioButtonState(Window->Release2EndButton,True);
  714.                     break;
  715.                 case eRelease2FromDefault:
  716.                     SetRadioButtonState(Window->Release2DefaultButton,True);
  717.                     break;
  718.             }
  719.  
  720.         Window->Accent1Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  721.             9,ACCENT1EDITX,ACCENT1EDITY,ACCENT1EDITWIDTH,ACCENT1EDITHEIGHT);
  722.         if (Window->Accent1Edit == NIL)
  723.             {
  724.              FailurePoint19:
  725.                 DisposeRadioButton(Window->Release2DefaultButton);
  726.                 goto FailurePoint18;
  727.             }
  728.         StringTemp = LongDoubleToString(GetNoteAccent1(Note),7,1e-4,1e6);
  729.         if (StringTemp == NIL)
  730.             {
  731.              FailurePoint20:
  732.                 DisposeTextEdit(Window->Accent1Edit);
  733.                 goto FailurePoint19;
  734.             }
  735.         TextEditNewRawData(Window->Accent1Edit,StringTemp,SYSTEMLINEFEED);
  736.         ReleasePtr(StringTemp);
  737.         TextEditHasBeenSaved(Window->Accent1Edit);
  738.  
  739.         Window->Accent2Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  740.             9,ACCENT2EDITX,ACCENT2EDITY,ACCENT2EDITWIDTH,ACCENT2EDITHEIGHT);
  741.         if (Window->Accent2Edit == NIL)
  742.             {
  743.              FailurePoint21:
  744.                 goto FailurePoint20;
  745.             }
  746.         StringTemp = LongDoubleToString(GetNoteAccent2(Note),7,1e-4,1e6);
  747.         if (StringTemp == NIL)
  748.             {
  749.              FailurePoint22:
  750.                 DisposeTextEdit(Window->Accent2Edit);
  751.                 goto FailurePoint21;
  752.             }
  753.         TextEditNewRawData(Window->Accent2Edit,StringTemp,SYSTEMLINEFEED);
  754.         ReleasePtr(StringTemp);
  755.         TextEditHasBeenSaved(Window->Accent2Edit);
  756.  
  757.         Window->Accent3Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  758.             9,ACCENT3EDITX,ACCENT3EDITY,ACCENT3EDITWIDTH,ACCENT3EDITHEIGHT);
  759.         if (Window->Accent3Edit == NIL)
  760.             {
  761.              FailurePoint23:
  762.                 goto FailurePoint22;
  763.             }
  764.         StringTemp = LongDoubleToString(GetNoteAccent3(Note),7,1e-4,1e6);
  765.         if (StringTemp == NIL)
  766.             {
  767.              FailurePoint24:
  768.                 DisposeTextEdit(Window->Accent3Edit);
  769.                 goto FailurePoint23;
  770.             }
  771.         TextEditNewRawData(Window->Accent3Edit,StringTemp,SYSTEMLINEFEED);
  772.         ReleasePtr(StringTemp);
  773.         TextEditHasBeenSaved(Window->Accent3Edit);
  774.  
  775.         Window->Accent4Edit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  776.             9,ACCENT4EDITX,ACCENT4EDITY,ACCENT4EDITWIDTH,ACCENT4EDITHEIGHT);
  777.         if (Window->Accent4Edit == NIL)
  778.             {
  779.              FailurePoint25:
  780.                 goto FailurePoint24;
  781.             }
  782.         StringTemp = LongDoubleToString(GetNoteAccent4(Note),7,1e-4,1e6);
  783.         if (StringTemp == NIL)
  784.             {
  785.              FailurePoint26:
  786.                 DisposeTextEdit(Window->Accent4Edit);
  787.                 goto FailurePoint25;
  788.             }
  789.         TextEditNewRawData(Window->Accent4Edit,StringTemp,SYSTEMLINEFEED);
  790.         ReleasePtr(StringTemp);
  791.         TextEditHasBeenSaved(Window->Accent4Edit);
  792.  
  793.         Window->PitchDispRateEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  794.             GetScreenFont(),9,PITCHDISPRATEEDITX,PITCHDISPRATEEDITY,PITCHDISPRATEEDITWIDTH,
  795.             PTICHDISPRATEEDITHEIGHT);
  796.         if (Window->PitchDispRateEdit == NIL)
  797.             {
  798.              FailurePoint27:
  799.                 goto FailurePoint26;
  800.             }
  801.         StringTemp = LongDoubleToString(GetNotePitchDisplacementRateAdjust(Note),7,1e-4,1e6);
  802.         if (StringTemp == NIL)
  803.             {
  804.              FailurePoint28:
  805.                 DisposeTextEdit(Window->PitchDispRateEdit);
  806.                 goto FailurePoint27;
  807.             }
  808.         TextEditNewRawData(Window->PitchDispRateEdit,StringTemp,SYSTEMLINEFEED);
  809.         ReleasePtr(StringTemp);
  810.         TextEditHasBeenSaved(Window->PitchDispRateEdit);
  811.  
  812.         Window->PitchDispDepthEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  813.             GetScreenFont(),9,PITCHDISPDEPTHEDITX,PITCHDISPDEPTHEDITY,PITCHDISPDEPTHEDITWIDTH,
  814.             PITCHDISPDEPTHEDITHEIGHT);
  815.         if (Window->PitchDispDepthEdit == NIL)
  816.             {
  817.              FailurePoint29:
  818.                 goto FailurePoint28;
  819.             }
  820.         StringTemp = LongDoubleToString(GetNotePitchDisplacementDepthAdjust(Note),
  821.             7,1e-4,1e6);
  822.         if (StringTemp == NIL)
  823.             {
  824.              FailurePoint30:
  825.                 DisposeTextEdit(Window->PitchDispDepthEdit);
  826.                 goto FailurePoint29;
  827.             }
  828.         TextEditNewRawData(Window->PitchDispDepthEdit,StringTemp,SYSTEMLINEFEED);
  829.         ReleasePtr(StringTemp);
  830.         TextEditHasBeenSaved(Window->PitchDispDepthEdit);
  831.  
  832.         Window->PitchDispDepthHertzButton = NewRadioButton(Window->ScreenID,"Hertz",
  833.             PITCHDISPDEPTHHERTZBUTTONX,PITCHDISPDEPTHHERTZBUTTONY,
  834.             PITCHDISPDEPTHHERTZBUTTONWIDTH,PITCHDISPDEPTHHERTZBUTTONHEIGHT);
  835.         if (Window->PitchDispDepthHertzButton == NIL)
  836.             {
  837.              FailurePoint31:
  838.                 goto FailurePoint30;
  839.             }
  840.  
  841.         Window->PitchDispDepthHalfStepButton = NewRadioButton(Window->ScreenID,"Halfsteps",
  842.             PITCHDISPDEPTHHALFSTEPBUTTONX,PITCHDISPDEPTHHALFSTEPBUTTONY,
  843.             PITCHDISPDEPTHHALFSTEPBUTTONWIDTH,PITCHDISPDEPTHHALFSTEPBUTTONHEIGHT);
  844.         if (Window->PitchDispDepthHalfStepButton == NIL)
  845.             {
  846.              FailurePoint32:
  847.                 DisposeRadioButton(Window->PitchDispDepthHertzButton);
  848.                 goto FailurePoint31;
  849.             }
  850.  
  851.         Window->PitchDispDepthDefaultButton = NewRadioButton(Window->ScreenID,"Default",
  852.             PITCHDISPDEPTHDEFAULTBUTTONX,PITCHDISPDEPTHDEFAULTBUTTONY,
  853.             PITCHDISPDEPTHDEFAULTBUTTONWIDTH,PITCHDISPDEPTHDEFAULTBUTTONHEIGHT);
  854.         if (Window->PitchDispDepthDefaultButton == NIL)
  855.             {
  856.              FailurePoint33:
  857.                 DisposeRadioButton(Window->PitchDispDepthHalfStepButton);
  858.                 goto FailurePoint32;
  859.             }
  860.  
  861.         switch (GetNotePitchDisplacementDepthConversionMode(Note))
  862.             {
  863.                 default:
  864.                     EXECUTE(PRERR(AllowResume,
  865.                         "EditNoteParametersDialog:  bad pitch disp depth control flag"));
  866.                     break;
  867.                 case ePitchDisplacementDepthModeHertz:
  868.                     SetRadioButtonState(Window->PitchDispDepthHertzButton,True);
  869.                     break;
  870.                 case ePitchDisplacementDepthModeHalfSteps:
  871.                     SetRadioButtonState(Window->PitchDispDepthHalfStepButton,True);
  872.                     break;
  873.                 case ePitchDisplacementDepthModeDefault:
  874.                     SetRadioButtonState(Window->PitchDispDepthDefaultButton,True);
  875.                     break;
  876.             }
  877.  
  878.         Window->HurryUpEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  879.             9,HURRYUPEDITX,HURRYUPEDITY,HURRYUPEDITWIDTH,HURRYUPEDITHEIGHT);
  880.         if (Window->HurryUpEdit == NIL)
  881.             {
  882.              FailurePoint34:
  883.                 DisposeRadioButton(Window->PitchDispDepthDefaultButton);
  884.                 goto FailurePoint33;
  885.             }
  886.         StringTemp = LongDoubleToString(GetNoteHurryUpFactor(Note),7,1e-4,1e6);
  887.         if (StringTemp == NIL)
  888.             {
  889.              FailurePoint35:
  890.                 DisposeTextEdit(Window->HurryUpEdit);
  891.                 goto FailurePoint34;
  892.             }
  893.         TextEditNewRawData(Window->HurryUpEdit,StringTemp,SYSTEMLINEFEED);
  894.         ReleasePtr(StringTemp);
  895.         TextEditHasBeenSaved(Window->HurryUpEdit);
  896.  
  897.         Window->PitchDispStartEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  898.             GetScreenFont(),9,PITCHDISPSTARTEDITX,PITCHDISPSTARTEDITY,
  899.             PITCHDISPSTARTEDITWIDTH,PITCHDISPSTARTEDITHEIGHT);
  900.         if (Window->PitchDispStartEdit == NIL)
  901.             {
  902.              FailurePoint36:
  903.                 goto FailurePoint35;
  904.             }
  905.         StringTemp = LongDoubleToString(GetNotePitchDisplacementStartPoint(Note),7,1e-4,1e6);
  906.         if (StringTemp == NIL)
  907.             {
  908.              FailurePoint37:
  909.                 DisposeTextEdit(Window->PitchDispStartEdit);
  910.                 goto FailurePoint36;
  911.             }
  912.         TextEditNewRawData(Window->PitchDispStartEdit,StringTemp,SYSTEMLINEFEED);
  913.         ReleasePtr(StringTemp);
  914.         TextEditHasBeenSaved(Window->PitchDispStartEdit);
  915.  
  916.         Window->PitchDispStartStartButton = NewRadioButton(Window->ScreenID,"Start",
  917.             PITCHDISPSTARTSTARTBUTTONX,PITCHDISPSTARTSTARTBUTTONY,
  918.             PITCHDISPSTARTSTARTBUTTONWIDTH,PITCHDISPSTARTSTARTBUTTONHEIGHT);
  919.         if (Window->PitchDispStartStartButton == NIL)
  920.             {
  921.              FailurePoint38:
  922.                 goto FailurePoint37;
  923.             }
  924.  
  925.         Window->PitchDispStartEndButton = NewRadioButton(Window->ScreenID,"End",
  926.             PITCHDISPSTARTENDBUTTONX,PITCHDISPSTARTENDBUTTONY,
  927.             PITCHDISPSTARTENDBUTTONWIDTH,PITCHDISPSTARTENDBUTTONHEIGHT);
  928.         if (Window->PitchDispStartEndButton == NIL)
  929.             {
  930.              FailurePoint39:
  931.                 DisposeRadioButton(Window->PitchDispStartStartButton);
  932.                 goto FailurePoint38;
  933.             }
  934.  
  935.         Window->PitchDispStartDefaultButton = NewRadioButton(Window->ScreenID,"Default",
  936.             PITCHDISPSTARTDEFAULTBUTTONX,PITCHDISPSTARTDEFAULTBUTTONY,
  937.             PITCHDISPSTARTDEFAULTBUTTONWIDTH,PITCHDISPSTARTDEFAULTBUTTONHEIGHT);
  938.         if (Window->PitchDispStartDefaultButton == NIL)
  939.             {
  940.              FailurePoint40:
  941.                 DisposeRadioButton(Window->PitchDispStartEndButton);
  942.                 goto FailurePoint39;
  943.             }
  944.  
  945.         switch (GetNotePitchDisplacementStartOrigin(Note))
  946.             {
  947.                 default:
  948.                     EXECUTE(PRERR(AllowResume,
  949.                         "EditNoteParametersDialog:  bad pitch disp start origin flag"));
  950.                     break;
  951.                 case ePitchDisplacementStartFromStart:
  952.                     SetRadioButtonState(Window->PitchDispStartStartButton,True);
  953.                     break;
  954.                 case ePitchDisplacementStartFromEnd:
  955.                     SetRadioButtonState(Window->PitchDispStartEndButton,True);
  956.                     break;
  957.                 case ePitchDisplacementStartFromDefault:
  958.                     SetRadioButtonState(Window->PitchDispStartDefaultButton,True);
  959.                     break;
  960.             }
  961.  
  962.         Window->StereoPosEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  963.             GetScreenFont(),9,STEREOPOSEDITX,STEREOPOSEDITY,STEREOPOSEDITWIDTH,
  964.             STEREOPOSEDITHEIGHT);
  965.         if (Window->StereoPosEdit == NIL)
  966.             {
  967.              FailurePoint41:
  968.                 DisposeRadioButton(Window->PitchDispStartDefaultButton);
  969.                 goto FailurePoint40;
  970.             }
  971.         StringTemp = LongDoubleToString(GetNoteStereoPositioning(Note),7,1e-4,1e6);
  972.         if (StringTemp == NIL)
  973.             {
  974.              FailurePoint42:
  975.                 DisposeTextEdit(Window->StereoPosEdit);
  976.                 goto FailurePoint41;
  977.             }
  978.         TextEditNewRawData(Window->StereoPosEdit,StringTemp,SYSTEMLINEFEED);
  979.         ReleasePtr(StringTemp);
  980.         TextEditHasBeenSaved(Window->StereoPosEdit);
  981.  
  982.         Window->DetuneEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,GetScreenFont(),
  983.             9,DETUNEEDITX,DETUNEEDITY,DETUNEEDITWIDTH,DETUNEEDITHEIGHT);
  984.         if (Window->DetuneEdit == NIL)
  985.             {
  986.              FailurePoint43:
  987.                 goto FailurePoint42;
  988.             }
  989.         StringTemp = LongDoubleToString(GetNoteDetuning(Note),7,1e-4,1e6);
  990.         if (StringTemp == NIL)
  991.             {
  992.              FailurePoint44:
  993.                 DisposeTextEdit(Window->DetuneEdit);
  994.                 goto FailurePoint43;
  995.             }
  996.         TextEditNewRawData(Window->DetuneEdit,StringTemp,SYSTEMLINEFEED);
  997.         ReleasePtr(StringTemp);
  998.         TextEditHasBeenSaved(Window->DetuneEdit);
  999.  
  1000.         Window->DetuneHertzButton = NewRadioButton(Window->ScreenID,"Hertz",
  1001.             DETUNEHERTZBUTTONX,DETUNEHERTZBUTTONY,DETUNEHERTZBUTTONWIDTH,
  1002.             DETUNEHERTZBUTTONHEIGHT);
  1003.         if (Window->DetuneHertzButton == NIL)
  1004.             {
  1005.              FailurePoint45:
  1006.                 goto FailurePoint44;
  1007.             }
  1008.  
  1009.         Window->DetuneHalfstepButton = NewRadioButton(Window->ScreenID,"Halfsteps",
  1010.             DETUNEHALFSTEPBUTTONX,DETUNEHALFSTEPBUTTONY,DETUNEHALFSTEPBUTTONWIDTH,
  1011.             DETUNEHALFSTEPBUTTONHEIGHT);
  1012.         if (Window->DetuneHalfstepButton == NIL)
  1013.             {
  1014.              FailurePoint46:
  1015.                 DisposeRadioButton(Window->DetuneHertzButton);
  1016.                 goto FailurePoint45;
  1017.             }
  1018.  
  1019.         Window->DetuneDefaultButton = NewRadioButton(Window->ScreenID,"Default",
  1020.             DETUNEDEFAULTBUTTONX,DETUNEDEFAULTBUTTONY,DETUNEDEFAULTBUTTONWIDTH,
  1021.             DETUNEDEFAULTBUTTONHEIGHT);
  1022.         if (Window->DetuneDefaultButton == NIL)
  1023.             {
  1024.              FailurePoint47:
  1025.                 DisposeRadioButton(Window->DetuneHalfstepButton);
  1026.                 goto FailurePoint46;
  1027.             }
  1028.  
  1029.         switch (GetNoteDetuneConversionMode(Note))
  1030.             {
  1031.                 default:
  1032.                     EXECUTE(PRERR(AllowResume,
  1033.                         "EditNoteParametersDialog:  bad detune conversion mode flag"));
  1034.                     break;
  1035.                 case eDetuningModeHertz:
  1036.                     SetRadioButtonState(Window->DetuneHertzButton,True);
  1037.                     break;
  1038.                 case eDetuningModeHalfSteps:
  1039.                     SetRadioButtonState(Window->DetuneHalfstepButton,True);
  1040.                     break;
  1041.                 case eDetuningModeDefault:
  1042.                     SetRadioButtonState(Window->DetuneDefaultButton,True);
  1043.                     break;
  1044.             }
  1045.  
  1046.         Window->DurationEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  1047.             GetScreenFont(),9,DURATIONEDITX,DURATIONEDITY,DURATIONEDITWIDTH,
  1048.             DURATIONEDITHEIGHT);
  1049.         if (Window->DurationEdit == NIL)
  1050.             {
  1051.              FailurePoint48:
  1052.                 DisposeRadioButton(Window->DetuneDefaultButton);
  1053.                 goto FailurePoint47;
  1054.             }
  1055.         StringTemp = NumericDurationToString(GetNoteDuration(Note),GetNoteDotStatus(Note),
  1056.             GetNoteDurationDivision(Note));
  1057.         if (StringTemp == NIL)
  1058.             {
  1059.              FailurePoint49:
  1060.                 DisposeTextEdit(Window->DurationEdit);
  1061.                 goto FailurePoint48;
  1062.             }
  1063.         TextEditNewRawData(Window->DurationEdit,StringTemp,SYSTEMLINEFEED);
  1064.         ReleasePtr(StringTemp);
  1065.         TextEditHasBeenSaved(Window->DurationEdit);
  1066.  
  1067.         Window->DurationAdjustEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  1068.             GetScreenFont(),9,DURATIONADJUSTEDITX,DURATIONADJUSTEDITY,
  1069.             DURATIONADJUSTEDITWIDTH,DURATIONADJUSTEDITHEIGHT);
  1070.         if (Window->DurationAdjustEdit == NIL)
  1071.             {
  1072.              FailurePoint50:
  1073.                 goto FailurePoint49;
  1074.             }
  1075.         StringTemp = LongDoubleToString(GetNoteDurationAdjust(Note),7,1e-4,1e6);
  1076.         if (StringTemp == NIL)
  1077.             {
  1078.              FailurePoint51:
  1079.                 DisposeTextEdit(Window->DurationAdjustEdit);
  1080.                 goto FailurePoint50;
  1081.             }
  1082.         TextEditNewRawData(Window->DurationAdjustEdit,StringTemp,SYSTEMLINEFEED);
  1083.         ReleasePtr(StringTemp);
  1084.         TextEditHasBeenSaved(Window->DurationAdjustEdit);
  1085.  
  1086.         Window->DurationAdjustAddButton = NewRadioButton(Window->ScreenID,"Add",
  1087.             DURATIONADJUSTADDBUTTONX,DURATIONADJUSTADDBUTTONY,DURATIONADJUSTADDBUTTONWIDTH,
  1088.             DURATIONADJUSTADDBUTTONHEIGHT);
  1089.         if (Window->DurationAdjustAddButton == NIL)
  1090.             {
  1091.              FailurePoint52:
  1092.                 goto FailurePoint51;
  1093.             }
  1094.  
  1095.         Window->DurationAdjustMultButton = NewRadioButton(Window->ScreenID,"Mult",
  1096.             DURATIONADJUSTMULTBUTTONX,DURATIONADJUSTMULTBUTTONY,DURATIONADJUSTMULTBUTTONWIDTH,
  1097.             DURATIONADJUSTMULTBOTTONHEIGHT);
  1098.         if (Window->DurationAdjustMultButton == NIL)
  1099.             {
  1100.              FailurePoint53:
  1101.                 DisposeRadioButton(Window->DurationAdjustAddButton);
  1102.                 goto FailurePoint52;
  1103.             }
  1104.  
  1105.         Window->DurationAdjustDefaultButton = NewRadioButton(Window->ScreenID,"Default",
  1106.             DURATIONADJUSTDEFAULTBUTTONX,DURATIONADJUSTDEFAULTBUTTONY,
  1107.             DURATIONADJUSTDEFAULTBUTTONWIDTH,DURATIONADJUSTDEFAULTBUTTONHEIGHT);
  1108.         if (Window->DurationAdjustDefaultButton == NIL)
  1109.             {
  1110.              FailurePoint54:
  1111.                 DisposeRadioButton(Window->DurationAdjustMultButton);
  1112.                 goto FailurePoint53;
  1113.             }
  1114.  
  1115.         switch (GetNoteDurationAdjustMode(Note))
  1116.             {
  1117.                 default:
  1118.                     EXECUTE(PRERR(AllowResume,
  1119.                         "EditNoteParametersDialog:  bad duration adjust mode flag"));
  1120.                     break;
  1121.                 case eDurationAdjustAdditive:
  1122.                     SetRadioButtonState(Window->DurationAdjustAddButton,True);
  1123.                     break;
  1124.                 case eDurationAdjustMultiplicative:
  1125.                     SetRadioButtonState(Window->DurationAdjustMultButton,True);
  1126.                     break;
  1127.                 case eDurationAdjustDefault:
  1128.                     SetRadioButtonState(Window->DurationAdjustDefaultButton,True);
  1129.                     break;
  1130.             }
  1131.  
  1132.         Window->RealPitchEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  1133.             GetScreenFont(),9,REALPITCHEDITX,REALPITCHEDITY,REALPITCHEDITWIDTH,
  1134.             REALPITCHEDITHEIGHT);
  1135.         if (Window->RealPitchEdit == NIL)
  1136.             {
  1137.              FailurePoint55:
  1138.                 DisposeRadioButton(Window->DurationAdjustDefaultButton);
  1139.                 goto FailurePoint54;
  1140.             }
  1141.         StringTemp = NumericPitchToString(GetNotePitch(Note),GetNoteFlatOrSharpStatus(Note));
  1142.         if (StringTemp == NIL)
  1143.             {
  1144.              FailurePoint56:
  1145.                 DisposeTextEdit(Window->RealPitchEdit);
  1146.                 goto FailurePoint55;
  1147.             }
  1148.         TextEditNewRawData(Window->RealPitchEdit,StringTemp,SYSTEMLINEFEED);
  1149.         ReleasePtr(StringTemp);
  1150.         TextEditHasBeenSaved(Window->RealPitchEdit);
  1151.  
  1152.         Window->FakePitchEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  1153.             GetScreenFont(),9,FAKEPITCHEDITX,FAKEPITCHEDITY,FAKEPITCHEDITWIDTH,
  1154.             FAKEPITCHEDITHEIGHT);
  1155.         if (Window->FakePitchEdit == NIL)
  1156.             {
  1157.              FailurePoint57:
  1158.                 goto FailurePoint56;
  1159.             }
  1160.         if (GetNoteMultisampleFalsePitch(Note) == -1)
  1161.             {
  1162.                 /* default */
  1163.                 StringTemp = StringToBlockCopy("default");
  1164.             }
  1165.          else
  1166.             {
  1167.                 StringTemp = NumericPitchToString(GetNoteMultisampleFalsePitch(Note),0);
  1168.             }
  1169.         if (StringTemp == NIL)
  1170.             {
  1171.              FailurePoint58:
  1172.                 DisposeTextEdit(Window->FakePitchEdit);
  1173.                 goto FailurePoint57;
  1174.             }
  1175.         TextEditNewRawData(Window->FakePitchEdit,StringTemp,SYSTEMLINEFEED);
  1176.         ReleasePtr(StringTemp);
  1177.         TextEditHasBeenSaved(Window->FakePitchEdit);
  1178.  
  1179.         Window->PortamentoEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  1180.             GetScreenFont(),9,PORTAMENTOEDITX,PORTAMENTOEDITY,PORTAMENTOEDITWIDTH,
  1181.             PORTAMENTOEDITHEIGHT);
  1182.         if (Window->PortamentoEdit == NIL)
  1183.             {
  1184.              FailurePoint59:
  1185.                 goto FailurePoint58;
  1186.             }
  1187.         StringTemp = LongDoubleToString(GetNotePortamentoDuration(Note),7,1e-4,1e6);
  1188.         if (StringTemp == NIL)
  1189.             {
  1190.              FailurePoint60:
  1191.                 DisposeTextEdit(Window->PortamentoEdit);
  1192.                 goto FailurePoint59;
  1193.             }
  1194.         TextEditNewRawData(Window->PortamentoEdit,StringTemp,SYSTEMLINEFEED);
  1195.         ReleasePtr(StringTemp);
  1196.         TextEditHasBeenSaved(Window->PortamentoEdit);
  1197.  
  1198.         Window->RestBox = NewCheckBox(Window->ScreenID,"Note Is Actually a Rest",
  1199.             RESTCHECKBOXX,RESTCHECKBOXY,RESTCHECKBOXWIDTH,RESTCHECKBOXHEIGHT);
  1200.         if (Window->RestBox == NIL)
  1201.             {
  1202.              FailurePoint61:
  1203.                 goto FailurePoint60;
  1204.             }
  1205.         if (GetNoteIsItARest(Note))
  1206.             {
  1207.                 SetCheckBoxState(Window->RestBox,True);
  1208.             }
  1209.  
  1210.         Window->PortaHertzButton = NewRadioButton(Window->ScreenID,"Hertz",
  1211.             PORTAHERTZBUTTONX,PORTAHERTZBUTTONY,PORTAHERTZBUTTONWIDTH,PORTAHERTZBUTTONHEIGHT);
  1212.         if (Window->PortaHertzButton == NIL)
  1213.             {
  1214.              FailurePoint62:
  1215.                 DisposeCheckBox(Window->RestBox);
  1216.                 goto FailurePoint61;
  1217.             }
  1218.  
  1219.         Window->PortaHalfstepButton = NewRadioButton(Window->ScreenID,"Halfsteps",
  1220.             PORTAHALFSTEPBUTTONX,PORTAHALFSTEPBUTTONY,PORTAHALFSTEPBUTTONWIDTH,
  1221.             PORTAHALFSTEPBUTTONHEIGHT);
  1222.         if (Window->PortaHalfstepButton == NIL)
  1223.             {
  1224.              FailurePoint63:
  1225.                 DisposeRadioButton(Window->PortaHertzButton);
  1226.                 goto FailurePoint62;
  1227.             }
  1228.  
  1229.         if (GetNotePortamentoHertzNotHalfstepsFlag(Note))
  1230.             {
  1231.                 SetRadioButtonState(Window->PortaHertzButton,True);
  1232.             }
  1233.          else
  1234.             {
  1235.                 SetRadioButtonState(Window->PortaHalfstepButton,True);
  1236.             }
  1237.  
  1238.         Window->RetrigBox = NewCheckBox(Window->ScreenID,"Retrigger Envelopes on Tie",
  1239.             RETRIGCHECKBOXX,RETRIGCHECKBOXY,RETRIGCHECKBOXWIDTH,RETRIGCHECKBOXHEIGHT);
  1240.         if (Window->RetrigBox == NIL)
  1241.             {
  1242.              FailurePoint64:
  1243.                 DisposeRadioButton(Window->PortaHalfstepButton);
  1244.                 goto FailurePoint63;
  1245.             }
  1246.         if (GetNoteRetriggerEnvelopesOnTieStatus(Note))
  1247.             {
  1248.                 SetCheckBoxState(Window->RetrigBox,True);
  1249.             }
  1250.  
  1251.         Window->Release3Box = NewCheckBox(Window->ScreenID,
  1252.             "Release 3 From Start Instead Of End",RELEASE3CHECKBOXX,RELEASE3CHECKBOXY,
  1253.             RELEASE3CHECKBOXWIDTH,RELEASE3CHECKBOXHEIGHT);
  1254.         if (Window->Release3Box == NIL)
  1255.             {
  1256.              FailurePoint65:
  1257.                 DisposeCheckBox(Window->RetrigBox);
  1258.                 goto FailurePoint64;
  1259.             }
  1260.         if (GetNoteRelease3FromStartInsteadOfEnd(Note))
  1261.             {
  1262.                 SetCheckBoxState(Window->Release3Box,True);
  1263.             }
  1264.  
  1265.         Window->SurroundPosEdit = NewTextEdit(Window->ScreenID,eTENoScrollBars,
  1266.             GetScreenFont(),9,SURROUNDPOSEDITX,SURROUNDPOSEDITY,SURROUNDPOSEDITWIDTH,
  1267.             SURROUNDPOSEDITHEIGHT);
  1268.         if (Window->SurroundPosEdit == NIL)
  1269.             {
  1270.              FailurePoint66:
  1271.                 DisposeCheckBox(Window->Release3Box);
  1272.                 goto FailurePoint65;
  1273.             }
  1274.         StringTemp = LongDoubleToString(GetNoteSurroundPositioning(Note),7,1e-4,1e6);
  1275.         if (StringTemp == NIL)
  1276.             {
  1277.              FailurePoint67:
  1278.                 DisposeTextEdit(Window->SurroundPosEdit);
  1279.                 goto FailurePoint66;
  1280.             }
  1281.         TextEditNewRawData(Window->SurroundPosEdit,StringTemp,SYSTEMLINEFEED);
  1282.         ReleasePtr(StringTemp);
  1283.         TextEditHasBeenSaved(Window->SurroundPosEdit);
  1284.  
  1285.  
  1286.         ActiveTextEdit = Window->EarlyLateEdit;
  1287.         EnableTextEditSelection(ActiveTextEdit);
  1288.         TextEditDoMenuSelectAll(ActiveTextEdit);
  1289.         LoopFlag = True;
  1290.         while (LoopFlag)
  1291.             {
  1292.                 OrdType                            X;
  1293.                 OrdType                            Y;
  1294.                 ModifierFlags                Modifiers;
  1295.                 MenuItemType*                MenuItem;
  1296.                 char                                KeyPress;
  1297.  
  1298.                 switch (GetAnEvent(&X,&Y,&Modifiers,NIL,&MenuItem,&KeyPress))
  1299.                     {
  1300.                         default:
  1301.                             break;
  1302.                         case eCheckCursor:
  1303.                             if (TextEditIBeamTest(Window->EarlyLateEdit,X,Y)
  1304.                                 || TextEditIBeamTest(Window->Release1Edit,X,Y)
  1305.                                 || TextEditIBeamTest(Window->LoudnessEdit,X,Y)
  1306.                                 || TextEditIBeamTest(Window->Release2Edit,X,Y)
  1307.                                 || TextEditIBeamTest(Window->Accent1Edit,X,Y)
  1308.                                 || TextEditIBeamTest(Window->Accent2Edit,X,Y)
  1309.                                 || TextEditIBeamTest(Window->Accent3Edit,X,Y)
  1310.                                 || TextEditIBeamTest(Window->Accent4Edit,X,Y)
  1311.                                 || TextEditIBeamTest(Window->PitchDispRateEdit,X,Y)
  1312.                                 || TextEditIBeamTest(Window->PitchDispDepthEdit,X,Y)
  1313.                                 || TextEditIBeamTest(Window->HurryUpEdit,X,Y)
  1314.                                 || TextEditIBeamTest(Window->PitchDispStartEdit,X,Y)
  1315.                                 || TextEditIBeamTest(Window->StereoPosEdit,X,Y)
  1316.                                 || TextEditIBeamTest(Window->SurroundPosEdit,X,Y)
  1317.                                 || TextEditIBeamTest(Window->DetuneEdit,X,Y)
  1318.                                 || TextEditIBeamTest(Window->DurationEdit,X,Y)
  1319.                                 || TextEditIBeamTest(Window->DurationAdjustEdit,X,Y)
  1320.                                 || TextEditIBeamTest(Window->RealPitchEdit,X,Y)
  1321.                                 || TextEditIBeamTest(Window->FakePitchEdit,X,Y)
  1322.                                 || TextEditIBeamTest(Window->PortamentoEdit,X,Y))
  1323.                                 {
  1324.                                     SetIBeamCursor();
  1325.                                 }
  1326.                              else
  1327.                                 {
  1328.                                     SetArrowCursor();
  1329.                                 }
  1330.                             goto UpdateCursorPoint;
  1331.                             break;
  1332.                         case eNoEvent:
  1333.                          UpdateCursorPoint:
  1334.                             TextEditUpdateCursor(ActiveTextEdit);
  1335.                             break;
  1336.                         case eMenuStarting:
  1337.                             EnableMenuItem(mPaste);
  1338.                             if (TextEditIsThereValidSelection(ActiveTextEdit))
  1339.                                 {
  1340.                                     EnableMenuItem(mCut);
  1341.                                     EnableMenuItem(mCopy);
  1342.                                     EnableMenuItem(mClear);
  1343.                                 }
  1344.                             EnableMenuItem(mSelectAll);
  1345.                             if (TextEditCanWeUndo(ActiveTextEdit))
  1346.                                 {
  1347.                                     EnableMenuItem(mUndo);
  1348.                                 }
  1349.                             break;
  1350.                         case eMenuCommand:
  1351.                             if (MenuItem == mPaste)
  1352.                                 {
  1353.                                     TextEditDoMenuPaste(ActiveTextEdit);
  1354.                                 }
  1355.                             else if (MenuItem == mCut)
  1356.                                 {
  1357.                                     TextEditDoMenuCut(ActiveTextEdit);
  1358.                                 }
  1359.                             else if (MenuItem == mCopy)
  1360.                                 {
  1361.                                     TextEditDoMenuCopy(ActiveTextEdit);
  1362.                                 }
  1363.                             else if (MenuItem == mClear)
  1364.                                 {
  1365.                                     TextEditDoMenuClear(ActiveTextEdit);
  1366.                                 }
  1367.                             else if (MenuItem == mUndo)
  1368.                                 {
  1369.                                     TextEditDoMenuUndo(ActiveTextEdit);
  1370.                                     TextEditShowSelection(ActiveTextEdit);
  1371.                                 }
  1372.                             else if (MenuItem == mSelectAll)
  1373.                                 {
  1374.                                     TextEditDoMenuSelectAll(ActiveTextEdit);
  1375.                                 }
  1376.                             else
  1377.                                 {
  1378.                                     EXECUTE(PRERR(AllowResume,
  1379.                                         "EditNoteParametersDialog: Undefined menu option chosen"));
  1380.                                 }
  1381.                             break;
  1382.                         case eKeyPressed:
  1383.                             if (KeyPress == 13)
  1384.                                 {
  1385.                                     FlashButton(Window->OKButton);
  1386.                                     DoItFlag = True;
  1387.                                     LoopFlag = False;
  1388.                                 }
  1389.                             else if (KeyPress == 9)
  1390.                                 {
  1391.                                     DisableTextEditSelection(ActiveTextEdit);
  1392.                                     if ((eShiftKey & Modifiers) == 0)
  1393.                                         {
  1394.                                             /* tab forwards */
  1395.                                             if (ActiveTextEdit == Window->EarlyLateEdit)
  1396.                                                 {
  1397.                                                     ActiveTextEdit = Window->Release1Edit;
  1398.                                                 }
  1399.                                             else if (ActiveTextEdit == Window->Release1Edit)
  1400.                                                 {
  1401.                                                     ActiveTextEdit = Window->LoudnessEdit;
  1402.                                                 }
  1403.                                             else if (ActiveTextEdit == Window->LoudnessEdit)
  1404.                                                 {
  1405.                                                     ActiveTextEdit = Window->Release2Edit;
  1406.                                                 }
  1407.                                             else if (ActiveTextEdit == Window->Release2Edit)
  1408.                                                 {
  1409.                                                     ActiveTextEdit = Window->Accent1Edit;
  1410.                                                 }
  1411.                                             else if (ActiveTextEdit == Window->Accent1Edit)
  1412.                                                 {
  1413.                                                     ActiveTextEdit = Window->Accent2Edit;
  1414.                                                 }
  1415.                                             else if (ActiveTextEdit == Window->Accent2Edit)
  1416.                                                 {
  1417.                                                     ActiveTextEdit = Window->Accent3Edit;
  1418.                                                 }
  1419.                                             else if (ActiveTextEdit == Window->Accent3Edit)
  1420.                                                 {
  1421.                                                     ActiveTextEdit = Window->Accent4Edit;
  1422.                                                 }
  1423.                                             else if (ActiveTextEdit == Window->Accent4Edit)
  1424.                                                 {
  1425.                                                     ActiveTextEdit = Window->PitchDispRateEdit;
  1426.                                                 }
  1427.                                             else if (ActiveTextEdit == Window->PitchDispRateEdit)
  1428.                                                 {
  1429.                                                     ActiveTextEdit = Window->PitchDispDepthEdit;
  1430.                                                 }
  1431.                                             else if (ActiveTextEdit == Window->PitchDispDepthEdit)
  1432.                                                 {
  1433.                                                     ActiveTextEdit = Window->HurryUpEdit;
  1434.                                                 }
  1435.                                             else if (ActiveTextEdit == Window->HurryUpEdit)
  1436.                                                 {
  1437.                                                     ActiveTextEdit = Window->PitchDispStartEdit;
  1438.                                                 }
  1439.                                             else if (ActiveTextEdit == Window->PitchDispStartEdit)
  1440.                                                 {
  1441.                                                     ActiveTextEdit = Window->StereoPosEdit;
  1442.                                                 }
  1443.                                             else if (ActiveTextEdit == Window->StereoPosEdit)
  1444.                                                 {
  1445.                                                     ActiveTextEdit = Window->DetuneEdit;
  1446.                                                 }
  1447.                                             else if (ActiveTextEdit == Window->DetuneEdit)
  1448.                                                 {
  1449.                                                     ActiveTextEdit = Window->SurroundPosEdit;
  1450.                                                 }
  1451.                                             else if (ActiveTextEdit == Window->SurroundPosEdit)
  1452.                                                 {
  1453.                                                     ActiveTextEdit = Window->DurationEdit;
  1454.                                                 }
  1455.                                             else if (ActiveTextEdit == Window->DurationEdit)
  1456.                                                 {
  1457.                                                     ActiveTextEdit = Window->DurationAdjustEdit;
  1458.                                                 }
  1459.                                             else if (ActiveTextEdit == Window->DurationAdjustEdit)
  1460.                                                 {
  1461.                                                     ActiveTextEdit = Window->RealPitchEdit;
  1462.                                                 }
  1463.                                             else if (ActiveTextEdit == Window->RealPitchEdit)
  1464.                                                 {
  1465.                                                     ActiveTextEdit = Window->FakePitchEdit;
  1466.                                                 }
  1467.                                             else if (ActiveTextEdit == Window->FakePitchEdit)
  1468.                                                 {
  1469.                                                     ActiveTextEdit = Window->PortamentoEdit;
  1470.                                                 }
  1471.                                             else
  1472.                                                 {
  1473.                                                     ActiveTextEdit = Window->EarlyLateEdit;
  1474.                                                 }
  1475.                                         }
  1476.                                      else
  1477.                                         {
  1478.                                             /* tab backwards */
  1479.                                             if (ActiveTextEdit == Window->PortamentoEdit)
  1480.                                                 {
  1481.                                                     ActiveTextEdit = Window->FakePitchEdit;
  1482.                                                 }
  1483.                                             else if (ActiveTextEdit == Window->FakePitchEdit)
  1484.                                                 {
  1485.                                                     ActiveTextEdit = Window->RealPitchEdit;
  1486.                                                 }
  1487.                                             else if (ActiveTextEdit == Window->RealPitchEdit)
  1488.                                                 {
  1489.                                                     ActiveTextEdit = Window->DurationAdjustEdit;
  1490.                                                 }
  1491.                                             else if (ActiveTextEdit == Window->DurationAdjustEdit)
  1492.                                                 {
  1493.                                                     ActiveTextEdit = Window->DurationEdit;
  1494.                                                 }
  1495.                                             else if (ActiveTextEdit == Window->DurationEdit)
  1496.                                                 {
  1497.                                                     ActiveTextEdit = Window->SurroundPosEdit;
  1498.                                                 }
  1499.                                             else if (ActiveTextEdit == Window->SurroundPosEdit)
  1500.                                                 {
  1501.                                                     ActiveTextEdit = Window->DetuneEdit;
  1502.                                                 }
  1503.                                             else if (ActiveTextEdit == Window->DetuneEdit)
  1504.                                                 {
  1505.                                                     ActiveTextEdit = Window->StereoPosEdit;
  1506.                                                 }
  1507.                                             else if (ActiveTextEdit == Window->StereoPosEdit)
  1508.                                                 {
  1509.                                                     ActiveTextEdit = Window->PitchDispStartEdit;
  1510.                                                 }
  1511.                                             else if (ActiveTextEdit == Window->PitchDispStartEdit)
  1512.                                                 {
  1513.                                                     ActiveTextEdit = Window->HurryUpEdit;
  1514.                                                 }
  1515.                                             else if (ActiveTextEdit == Window->HurryUpEdit)
  1516.                                                 {
  1517.                                                     ActiveTextEdit = Window->PitchDispDepthEdit;
  1518.                                                 }
  1519.                                             else if (ActiveTextEdit == Window->PitchDispDepthEdit)
  1520.                                                 {
  1521.                                                     ActiveTextEdit = Window->PitchDispRateEdit;
  1522.                                                 }
  1523.                                             else if (ActiveTextEdit == Window->PitchDispRateEdit)
  1524.                                                 {
  1525.                                                     ActiveTextEdit = Window->Accent4Edit;
  1526.                                                 }
  1527.                                             else if (ActiveTextEdit == Window->Accent4Edit)
  1528.                                                 {
  1529.                                                     ActiveTextEdit = Window->Accent3Edit;
  1530.                                                 }
  1531.                                             else if (ActiveTextEdit == Window->Accent3Edit)
  1532.                                                 {
  1533.                                                     ActiveTextEdit = Window->Accent2Edit;
  1534.                                                 }
  1535.                                             else if (ActiveTextEdit == Window->Accent2Edit)
  1536.                                                 {
  1537.                                                     ActiveTextEdit = Window->Accent1Edit;
  1538.                                                 }
  1539.                                             else if (ActiveTextEdit == Window->Accent1Edit)
  1540.                                                 {
  1541.                                                     ActiveTextEdit = Window->Release2Edit;
  1542.                                                 }
  1543.                                             else if (ActiveTextEdit == Window->Release2Edit)
  1544.                                                 {
  1545.                                                     ActiveTextEdit = Window->LoudnessEdit;
  1546.                                                 }
  1547.                                             else if (ActiveTextEdit == Window->LoudnessEdit)
  1548.                                                 {
  1549.                                                     ActiveTextEdit = Window->Release1Edit;
  1550.                                                 }
  1551.                                             else if (ActiveTextEdit == Window->Release1Edit)
  1552.                                                 {
  1553.                                                     ActiveTextEdit = Window->EarlyLateEdit;
  1554.                                                 }
  1555.                                             else
  1556.                                                 {
  1557.                                                     ActiveTextEdit = Window->PortamentoEdit;
  1558.                                                 }
  1559.                                         }
  1560.                                     TextEditDoMenuSelectAll(ActiveTextEdit);
  1561.                                     EnableTextEditSelection(ActiveTextEdit);
  1562.                                 }
  1563.                             else if (KeyPress == eCancelKey)
  1564.                                 {
  1565.                                     FlashButton(Window->CancelButton);
  1566.                                     DoItFlag = False;
  1567.                                     LoopFlag = False;
  1568.                                 }
  1569.                             else
  1570.                                 {
  1571.                                     TextEditDoKeyPressed(ActiveTextEdit,KeyPress,Modifiers);
  1572.                                 }
  1573.                             break;
  1574.                         case eMouseDown:
  1575.                             if (SimpleButtonHitTest(Window->OKButton,X,Y))
  1576.                                 {
  1577.                                     if (SimpleButtonMouseDown(Window->OKButton,X,Y,NIL,NIL))
  1578.                                         {
  1579.                                             DoItFlag = True;
  1580.                                             LoopFlag = False;
  1581.                                         }
  1582.                                 }
  1583.                             else if (SimpleButtonHitTest(Window->CancelButton,X,Y))
  1584.                                 {
  1585.                                     if (SimpleButtonMouseDown(Window->CancelButton,X,Y,NIL,NIL))
  1586.                                         {
  1587.                                             DoItFlag = False;
  1588.                                             LoopFlag = False;
  1589.                                         }
  1590.                                 }
  1591.                             else if (TextEditHitTest(Window->EarlyLateEdit,X,Y))
  1592.                                 {
  1593.                                     if (ActiveTextEdit != Window->EarlyLateEdit)
  1594.                                         {
  1595.                                             DisableTextEditSelection(ActiveTextEdit);
  1596.                                             ActiveTextEdit = Window->EarlyLateEdit;
  1597.                                             EnableTextEditSelection(ActiveTextEdit);
  1598.                                         }
  1599.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1600.                                 }
  1601.                             else if (TextEditHitTest(Window->Release1Edit,X,Y))
  1602.                                 {
  1603.                                     if (ActiveTextEdit != Window->Release1Edit)
  1604.                                         {
  1605.                                             DisableTextEditSelection(ActiveTextEdit);
  1606.                                             ActiveTextEdit = Window->Release1Edit;
  1607.                                             EnableTextEditSelection(ActiveTextEdit);
  1608.                                         }
  1609.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1610.                                 }
  1611.                             else if (RadioButtonHitTest(Window->Release1StartButton,X,Y))
  1612.                                 {
  1613.                                     if (RadioButtonMouseDown(Window->Release1StartButton,X,Y))
  1614.                                         {
  1615.                                             SetRadioButtonState(Window->Release1EndButton,False);
  1616.                                             SetRadioButtonState(Window->Release1DefaultButton,False);
  1617.                                         }
  1618.                                 }
  1619.                             else if (RadioButtonHitTest(Window->Release1EndButton,X,Y))
  1620.                                 {
  1621.                                     if (RadioButtonMouseDown(Window->Release1EndButton,X,Y))
  1622.                                         {
  1623.                                             SetRadioButtonState(Window->Release1StartButton,False);
  1624.                                             SetRadioButtonState(Window->Release1DefaultButton,False);
  1625.                                         }
  1626.                                 }
  1627.                             else if (RadioButtonHitTest(Window->Release1DefaultButton,X,Y))
  1628.                                 {
  1629.                                     if (RadioButtonMouseDown(Window->Release1DefaultButton,X,Y))
  1630.                                         {
  1631.                                             SetRadioButtonState(Window->Release1StartButton,False);
  1632.                                             SetRadioButtonState(Window->Release1EndButton,False);
  1633.                                         }
  1634.                                 }
  1635.                             else if (TextEditHitTest(Window->LoudnessEdit,X,Y))
  1636.                                 {
  1637.                                     if (ActiveTextEdit != Window->LoudnessEdit)
  1638.                                         {
  1639.                                             DisableTextEditSelection(ActiveTextEdit);
  1640.                                             ActiveTextEdit = Window->LoudnessEdit;
  1641.                                             EnableTextEditSelection(ActiveTextEdit);
  1642.                                         }
  1643.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1644.                                 }
  1645.                             else if (TextEditHitTest(Window->Release2Edit,X,Y))
  1646.                                 {
  1647.                                     if (ActiveTextEdit != Window->Release2Edit)
  1648.                                         {
  1649.                                             DisableTextEditSelection(ActiveTextEdit);
  1650.                                             ActiveTextEdit = Window->Release2Edit;
  1651.                                             EnableTextEditSelection(ActiveTextEdit);
  1652.                                         }
  1653.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1654.                                 }
  1655.                             else if (RadioButtonHitTest(Window->Release2StartButton,X,Y))
  1656.                                 {
  1657.                                     if (RadioButtonMouseDown(Window->Release2StartButton,X,Y))
  1658.                                         {
  1659.                                             SetRadioButtonState(Window->Release2EndButton,False);
  1660.                                             SetRadioButtonState(Window->Release2DefaultButton,False);
  1661.                                         }
  1662.                                 }
  1663.                             else if (RadioButtonHitTest(Window->Release2EndButton,X,Y))
  1664.                                 {
  1665.                                     if (RadioButtonMouseDown(Window->Release2EndButton,X,Y))
  1666.                                         {
  1667.                                             SetRadioButtonState(Window->Release2StartButton,False);
  1668.                                             SetRadioButtonState(Window->Release2DefaultButton,False);
  1669.                                         }
  1670.                                 }
  1671.                             else if (RadioButtonHitTest(Window->Release2DefaultButton,X,Y))
  1672.                                 {
  1673.                                     if (RadioButtonMouseDown(Window->Release2DefaultButton,X,Y))
  1674.                                         {
  1675.                                             SetRadioButtonState(Window->Release2StartButton,False);
  1676.                                             SetRadioButtonState(Window->Release2EndButton,False);
  1677.                                         }
  1678.                                 }
  1679.                             else if (TextEditHitTest(Window->Accent1Edit,X,Y))
  1680.                                 {
  1681.                                     if (ActiveTextEdit != Window->Accent1Edit)
  1682.                                         {
  1683.                                             DisableTextEditSelection(ActiveTextEdit);
  1684.                                             ActiveTextEdit = Window->Accent1Edit;
  1685.                                             EnableTextEditSelection(ActiveTextEdit);
  1686.                                         }
  1687.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1688.                                 }
  1689.                             else if (TextEditHitTest(Window->Accent2Edit,X,Y))
  1690.                                 {
  1691.                                     if (ActiveTextEdit != Window->Accent2Edit)
  1692.                                         {
  1693.                                             DisableTextEditSelection(ActiveTextEdit);
  1694.                                             ActiveTextEdit = Window->Accent2Edit;
  1695.                                             EnableTextEditSelection(ActiveTextEdit);
  1696.                                         }
  1697.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1698.                                 }
  1699.                             else if (TextEditHitTest(Window->Accent3Edit,X,Y))
  1700.                                 {
  1701.                                     if (ActiveTextEdit != Window->Accent3Edit)
  1702.                                         {
  1703.                                             DisableTextEditSelection(ActiveTextEdit);
  1704.                                             ActiveTextEdit = Window->Accent3Edit;
  1705.                                             EnableTextEditSelection(ActiveTextEdit);
  1706.                                         }
  1707.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1708.                                 }
  1709.                             else if (TextEditHitTest(Window->Accent4Edit,X,Y))
  1710.                                 {
  1711.                                     if (ActiveTextEdit != Window->Accent4Edit)
  1712.                                         {
  1713.                                             DisableTextEditSelection(ActiveTextEdit);
  1714.                                             ActiveTextEdit = Window->Accent4Edit;
  1715.                                             EnableTextEditSelection(ActiveTextEdit);
  1716.                                         }
  1717.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1718.                                 }
  1719.                             else if (TextEditHitTest(Window->PitchDispRateEdit,X,Y))
  1720.                                 {
  1721.                                     if (ActiveTextEdit != Window->PitchDispRateEdit)
  1722.                                         {
  1723.                                             DisableTextEditSelection(ActiveTextEdit);
  1724.                                             ActiveTextEdit = Window->PitchDispRateEdit;
  1725.                                             EnableTextEditSelection(ActiveTextEdit);
  1726.                                         }
  1727.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1728.                                 }
  1729.                             else if (TextEditHitTest(Window->PitchDispDepthEdit,X,Y))
  1730.                                 {
  1731.                                     if (ActiveTextEdit != Window->PitchDispDepthEdit)
  1732.                                         {
  1733.                                             DisableTextEditSelection(ActiveTextEdit);
  1734.                                             ActiveTextEdit = Window->PitchDispDepthEdit;
  1735.                                             EnableTextEditSelection(ActiveTextEdit);
  1736.                                         }
  1737.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1738.                                 }
  1739.                             else if (RadioButtonHitTest(Window->PitchDispDepthHertzButton,X,Y))
  1740.                                 {
  1741.                                     if (RadioButtonMouseDown(Window->PitchDispDepthHertzButton,X,Y))
  1742.                                         {
  1743.                                             SetRadioButtonState(Window->PitchDispDepthHalfStepButton,False);
  1744.                                             SetRadioButtonState(Window->PitchDispDepthDefaultButton,False);
  1745.                                         }
  1746.                                 }
  1747.                             else if (RadioButtonHitTest(Window->PitchDispDepthHalfStepButton,X,Y))
  1748.                                 {
  1749.                                     if (RadioButtonMouseDown(Window->PitchDispDepthHalfStepButton,X,Y))
  1750.                                         {
  1751.                                             SetRadioButtonState(Window->PitchDispDepthHertzButton,False);
  1752.                                             SetRadioButtonState(Window->PitchDispDepthDefaultButton,False);
  1753.                                         }
  1754.                                 }
  1755.                             else if (RadioButtonHitTest(Window->PitchDispDepthDefaultButton,X,Y))
  1756.                                 {
  1757.                                     if (RadioButtonMouseDown(Window->PitchDispDepthDefaultButton,X,Y))
  1758.                                         {
  1759.                                             SetRadioButtonState(Window->PitchDispDepthHalfStepButton,False);
  1760.                                             SetRadioButtonState(Window->PitchDispDepthHertzButton,False);
  1761.                                         }
  1762.                                 }
  1763.                             else if (TextEditHitTest(Window->HurryUpEdit,X,Y))
  1764.                                 {
  1765.                                     if (ActiveTextEdit != Window->HurryUpEdit)
  1766.                                         {
  1767.                                             DisableTextEditSelection(ActiveTextEdit);
  1768.                                             ActiveTextEdit = Window->HurryUpEdit;
  1769.                                             EnableTextEditSelection(ActiveTextEdit);
  1770.                                         }
  1771.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1772.                                 }
  1773.                             else if (TextEditHitTest(Window->PitchDispStartEdit,X,Y))
  1774.                                 {
  1775.                                     if (ActiveTextEdit != Window->PitchDispStartEdit)
  1776.                                         {
  1777.                                             DisableTextEditSelection(ActiveTextEdit);
  1778.                                             ActiveTextEdit = Window->PitchDispStartEdit;
  1779.                                             EnableTextEditSelection(ActiveTextEdit);
  1780.                                         }
  1781.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1782.                                 }
  1783.                             else if (RadioButtonHitTest(Window->PitchDispStartStartButton,X,Y))
  1784.                                 {
  1785.                                     if (RadioButtonMouseDown(Window->PitchDispStartStartButton,X,Y))
  1786.                                         {
  1787.                                             SetRadioButtonState(Window->PitchDispStartEndButton,False);
  1788.                                             SetRadioButtonState(Window->PitchDispStartDefaultButton,False);
  1789.                                         }
  1790.                                 }
  1791.                             else if (RadioButtonHitTest(Window->PitchDispStartEndButton,X,Y))
  1792.                                 {
  1793.                                     if (RadioButtonMouseDown(Window->PitchDispStartEndButton,X,Y))
  1794.                                         {
  1795.                                             SetRadioButtonState(Window->PitchDispStartStartButton,False);
  1796.                                             SetRadioButtonState(Window->PitchDispStartDefaultButton,False);
  1797.                                         }
  1798.                                 }
  1799.                             else if (RadioButtonHitTest(Window->PitchDispStartDefaultButton,X,Y))
  1800.                                 {
  1801.                                     if (RadioButtonMouseDown(Window->PitchDispStartDefaultButton,X,Y))
  1802.                                         {
  1803.                                             SetRadioButtonState(Window->PitchDispStartStartButton,False);
  1804.                                             SetRadioButtonState(Window->PitchDispStartEndButton,False);
  1805.                                         }
  1806.                                 }
  1807.                             else if (TextEditHitTest(Window->StereoPosEdit,X,Y))
  1808.                                 {
  1809.                                     if (ActiveTextEdit != Window->StereoPosEdit)
  1810.                                         {
  1811.                                             DisableTextEditSelection(ActiveTextEdit);
  1812.                                             ActiveTextEdit = Window->StereoPosEdit;
  1813.                                             EnableTextEditSelection(ActiveTextEdit);
  1814.                                         }
  1815.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1816.                                 }
  1817.                             else if (TextEditHitTest(Window->SurroundPosEdit,X,Y))
  1818.                                 {
  1819.                                     if (ActiveTextEdit != Window->SurroundPosEdit)
  1820.                                         {
  1821.                                             DisableTextEditSelection(ActiveTextEdit);
  1822.                                             ActiveTextEdit = Window->SurroundPosEdit;
  1823.                                             EnableTextEditSelection(ActiveTextEdit);
  1824.                                         }
  1825.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1826.                                 }
  1827.                             else if (TextEditHitTest(Window->DetuneEdit,X,Y))
  1828.                                 {
  1829.                                     if (ActiveTextEdit != Window->DetuneEdit)
  1830.                                         {
  1831.                                             DisableTextEditSelection(ActiveTextEdit);
  1832.                                             ActiveTextEdit = Window->DetuneEdit;
  1833.                                             EnableTextEditSelection(ActiveTextEdit);
  1834.                                         }
  1835.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1836.                                 }
  1837.                             else if (RadioButtonHitTest(Window->DetuneHertzButton,X,Y))
  1838.                                 {
  1839.                                     if (RadioButtonMouseDown(Window->DetuneHertzButton,X,Y))
  1840.                                         {
  1841.                                             SetRadioButtonState(Window->DetuneHalfstepButton,False);
  1842.                                             SetRadioButtonState(Window->DetuneDefaultButton,False);
  1843.                                         }
  1844.                                 }
  1845.                             else if (RadioButtonHitTest(Window->DetuneHalfstepButton,X,Y))
  1846.                                 {
  1847.                                     if (RadioButtonMouseDown(Window->DetuneHalfstepButton,X,Y))
  1848.                                         {
  1849.                                             SetRadioButtonState(Window->DetuneHertzButton,False);
  1850.                                             SetRadioButtonState(Window->DetuneDefaultButton,False);
  1851.                                         }
  1852.                                 }
  1853.                             else if (RadioButtonHitTest(Window->DetuneDefaultButton,X,Y))
  1854.                                 {
  1855.                                     if (RadioButtonMouseDown(Window->DetuneDefaultButton,X,Y))
  1856.                                         {
  1857.                                             SetRadioButtonState(Window->DetuneHertzButton,False);
  1858.                                             SetRadioButtonState(Window->DetuneHalfstepButton,False);
  1859.                                         }
  1860.                                 }
  1861.                             else if (TextEditHitTest(Window->DurationEdit,X,Y))
  1862.                                 {
  1863.                                     if (ActiveTextEdit != Window->DurationEdit)
  1864.                                         {
  1865.                                             DisableTextEditSelection(ActiveTextEdit);
  1866.                                             ActiveTextEdit = Window->DurationEdit;
  1867.                                             EnableTextEditSelection(ActiveTextEdit);
  1868.                                         }
  1869.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1870.                                 }
  1871.                             else if (TextEditHitTest(Window->DurationAdjustEdit,X,Y))
  1872.                                 {
  1873.                                     if (ActiveTextEdit != Window->DurationAdjustEdit)
  1874.                                         {
  1875.                                             DisableTextEditSelection(ActiveTextEdit);
  1876.                                             ActiveTextEdit = Window->DurationAdjustEdit;
  1877.                                             EnableTextEditSelection(ActiveTextEdit);
  1878.                                         }
  1879.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1880.                                 }
  1881.                             else if (RadioButtonHitTest(Window->DurationAdjustAddButton,X,Y))
  1882.                                 {
  1883.                                     if (RadioButtonMouseDown(Window->DurationAdjustAddButton,X,Y))
  1884.                                         {
  1885.                                             SetRadioButtonState(Window->DurationAdjustMultButton,False);
  1886.                                             SetRadioButtonState(Window->DurationAdjustDefaultButton,False);
  1887.                                         }
  1888.                                 }
  1889.                             else if (RadioButtonHitTest(Window->DurationAdjustMultButton,X,Y))
  1890.                                 {
  1891.                                     if (RadioButtonMouseDown(Window->DurationAdjustMultButton,X,Y))
  1892.                                         {
  1893.                                             SetRadioButtonState(Window->DurationAdjustAddButton,False);
  1894.                                             SetRadioButtonState(Window->DurationAdjustDefaultButton,False);
  1895.                                         }
  1896.                                 }
  1897.                             else if (RadioButtonHitTest(Window->DurationAdjustDefaultButton,X,Y))
  1898.                                 {
  1899.                                     if (RadioButtonMouseDown(Window->DurationAdjustDefaultButton,X,Y))
  1900.                                         {
  1901.                                             SetRadioButtonState(Window->DurationAdjustAddButton,False);
  1902.                                             SetRadioButtonState(Window->DurationAdjustMultButton,False);
  1903.                                         }
  1904.                                 }
  1905.                             else if (TextEditHitTest(Window->RealPitchEdit,X,Y))
  1906.                                 {
  1907.                                     if (ActiveTextEdit != Window->RealPitchEdit)
  1908.                                         {
  1909.                                             DisableTextEditSelection(ActiveTextEdit);
  1910.                                             ActiveTextEdit = Window->RealPitchEdit;
  1911.                                             EnableTextEditSelection(ActiveTextEdit);
  1912.                                         }
  1913.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1914.                                 }
  1915.                             else if (TextEditHitTest(Window->FakePitchEdit,X,Y))
  1916.                                 {
  1917.                                     if (ActiveTextEdit != Window->FakePitchEdit)
  1918.                                         {
  1919.                                             DisableTextEditSelection(ActiveTextEdit);
  1920.                                             ActiveTextEdit = Window->FakePitchEdit;
  1921.                                             EnableTextEditSelection(ActiveTextEdit);
  1922.                                         }
  1923.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1924.                                 }
  1925.                             else if (TextEditHitTest(Window->PortamentoEdit,X,Y))
  1926.                                 {
  1927.                                     if (ActiveTextEdit != Window->PortamentoEdit)
  1928.                                         {
  1929.                                             DisableTextEditSelection(ActiveTextEdit);
  1930.                                             ActiveTextEdit = Window->PortamentoEdit;
  1931.                                             EnableTextEditSelection(ActiveTextEdit);
  1932.                                         }
  1933.                                     TextEditDoMouseDown(ActiveTextEdit,X,Y,Modifiers);
  1934.                                 }
  1935.                             else if (CheckBoxHitTest(Window->RestBox,X,Y))
  1936.                                 {
  1937.                                     CheckBoxMouseDown(Window->RestBox,X,Y);
  1938.                                 }
  1939.                             else if (RadioButtonHitTest(Window->PortaHertzButton,X,Y))
  1940.                                 {
  1941.                                     if (RadioButtonMouseDown(Window->PortaHertzButton,X,Y))
  1942.                                         {
  1943.                                             SetRadioButtonState(Window->PortaHalfstepButton,False);
  1944.                                         }
  1945.                                 }
  1946.                             else if (RadioButtonHitTest(Window->PortaHalfstepButton,X,Y))
  1947.                                 {
  1948.                                     if (RadioButtonMouseDown(Window->PortaHalfstepButton,X,Y))
  1949.                                         {
  1950.                                             SetRadioButtonState(Window->PortaHertzButton,False);
  1951.                                         }
  1952.                                 }
  1953.                             else if (CheckBoxHitTest(Window->RetrigBox,X,Y))
  1954.                                 {
  1955.                                     CheckBoxMouseDown(Window->RetrigBox,X,Y);
  1956.                                 }
  1957.                             else if (CheckBoxHitTest(Window->Release3Box,X,Y))
  1958.                                 {
  1959.                                     CheckBoxMouseDown(Window->Release3Box,X,Y);
  1960.                                 }
  1961.                             break;
  1962.                     }
  1963.             }
  1964.         ERROR((DoItFlag != True) && (DoItFlag != False),PRERR(ForceAbort,
  1965.             "EditNoteParametersDialog:  DoItFlag is neither true nor false"));
  1966.  
  1967.         if (DoItFlag)
  1968.             {
  1969.                 MyBoolean                    ErrorNoMemory;
  1970.  
  1971.                 /* this is a bit of overkill.  we should only mark the object as altered */
  1972.                 /* if something was actually changed.  and there's no reason to recompute */
  1973.                 /* the entire schedule. */
  1974.                 TrackObjectAltered(Track,0);
  1975.  
  1976.                 ErrorNoMemory = False;
  1977.  
  1978.                 if (TextEditDoesItNeedToBeSaved(Window->EarlyLateEdit))
  1979.                     {
  1980.                         StringTemp = TextEditGetRawData(Window->EarlyLateEdit,SYSTEMLINEFEED);
  1981.                         if (StringTemp == NIL)
  1982.                             {
  1983.                                 ErrorNoMemory = True;
  1984.                             }
  1985.                          else
  1986.                             {
  1987.                                 PutNoteEarlyLateAdjust(Note,StringToLongDouble(StringTemp,
  1988.                                     PtrSize(StringTemp)));
  1989.                                 ReleasePtr(StringTemp);
  1990.                             }
  1991.                     }
  1992.  
  1993.                 if (TextEditDoesItNeedToBeSaved(Window->Release1Edit))
  1994.                     {
  1995.                         StringTemp = TextEditGetRawData(Window->Release1Edit,SYSTEMLINEFEED);
  1996.                         if (StringTemp == NIL)
  1997.                             {
  1998.                                 ErrorNoMemory = True;
  1999.                             }
  2000.                          else
  2001.                             {
  2002.                                 PutNoteReleasePoint1(Note,StringToLongDouble(StringTemp,
  2003.                                     PtrSize(StringTemp)));
  2004.                                 ReleasePtr(StringTemp);
  2005.                             }
  2006.                     }
  2007.  
  2008.                 if (GetRadioButtonState(Window->Release1StartButton))
  2009.                     {
  2010.                         PutNoteRelease1Origin(Note,eRelease1FromStart);
  2011.                     }
  2012.                 else if (GetRadioButtonState(Window->Release1EndButton))
  2013.                     {
  2014.                         PutNoteRelease1Origin(Note,eRelease1FromEnd);
  2015.                     }
  2016.                 else if (GetRadioButtonState(Window->Release1DefaultButton))
  2017.                     {
  2018.                         PutNoteRelease1Origin(Note,eRelease1FromDefault);
  2019.                     }
  2020.                 else
  2021.                     {
  2022.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  release point 1 "
  2023.                             "radio buttons are in an inconsistent state"));
  2024.                     }
  2025.  
  2026.                 if (TextEditDoesItNeedToBeSaved(Window->LoudnessEdit))
  2027.                     {
  2028.                         StringTemp = TextEditGetRawData(Window->LoudnessEdit,SYSTEMLINEFEED);
  2029.                         if (StringTemp == NIL)
  2030.                             {
  2031.                                 ErrorNoMemory = True;
  2032.                             }
  2033.                          else
  2034.                             {
  2035.                                 PutNoteOverallLoudnessAdjustment(Note,StringToLongDouble(StringTemp,
  2036.                                     PtrSize(StringTemp)));
  2037.                                 ReleasePtr(StringTemp);
  2038.                             }
  2039.                     }
  2040.  
  2041.                 if (TextEditDoesItNeedToBeSaved(Window->Release2Edit))
  2042.                     {
  2043.                         StringTemp = TextEditGetRawData(Window->Release2Edit,SYSTEMLINEFEED);
  2044.                         if (StringTemp == NIL)
  2045.                             {
  2046.                                 ErrorNoMemory = True;
  2047.                             }
  2048.                          else
  2049.                             {
  2050.                                 PutNoteReleasePoint2(Note,StringToLongDouble(StringTemp,
  2051.                                     PtrSize(StringTemp)));
  2052.                                 ReleasePtr(StringTemp);
  2053.                             }
  2054.                     }
  2055.  
  2056.                 if (GetRadioButtonState(Window->Release2StartButton))
  2057.                     {
  2058.                         PutNoteRelease2Origin(Note,eRelease2FromStart);
  2059.                     }
  2060.                 else if (GetRadioButtonState(Window->Release2EndButton))
  2061.                     {
  2062.                         PutNoteRelease2Origin(Note,eRelease2FromEnd);
  2063.                     }
  2064.                 else if (GetRadioButtonState(Window->Release2DefaultButton))
  2065.                     {
  2066.                         PutNoteRelease2Origin(Note,eRelease2FromDefault);
  2067.                     }
  2068.                 else
  2069.                     {
  2070.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  release point 2 "
  2071.                             "radio buttons are in an inconsistent state"));
  2072.                     }
  2073.  
  2074.                 if (TextEditDoesItNeedToBeSaved(Window->Accent1Edit))
  2075.                     {
  2076.                         StringTemp = TextEditGetRawData(Window->Accent1Edit,SYSTEMLINEFEED);
  2077.                         if (StringTemp == NIL)
  2078.                             {
  2079.                                 ErrorNoMemory = True;
  2080.                             }
  2081.                          else
  2082.                             {
  2083.                                 PutNoteAccent1(Note,StringToLongDouble(StringTemp,PtrSize(StringTemp)));
  2084.                                 ReleasePtr(StringTemp);
  2085.                             }
  2086.                     }
  2087.  
  2088.                 if (TextEditDoesItNeedToBeSaved(Window->Accent2Edit))
  2089.                     {
  2090.                         StringTemp = TextEditGetRawData(Window->Accent2Edit,SYSTEMLINEFEED);
  2091.                         if (StringTemp == NIL)
  2092.                             {
  2093.                                 ErrorNoMemory = True;
  2094.                             }
  2095.                          else
  2096.                             {
  2097.                                 PutNoteAccent2(Note,StringToLongDouble(StringTemp,PtrSize(StringTemp)));
  2098.                                 ReleasePtr(StringTemp);
  2099.                             }
  2100.                     }
  2101.  
  2102.                 if (TextEditDoesItNeedToBeSaved(Window->Accent3Edit))
  2103.                     {
  2104.                         StringTemp = TextEditGetRawData(Window->Accent3Edit,SYSTEMLINEFEED);
  2105.                         if (StringTemp == NIL)
  2106.                             {
  2107.                                 ErrorNoMemory = True;
  2108.                             }
  2109.                          else
  2110.                             {
  2111.                                 PutNoteAccent3(Note,StringToLongDouble(StringTemp,PtrSize(StringTemp)));
  2112.                                 ReleasePtr(StringTemp);
  2113.                             }
  2114.                     }
  2115.  
  2116.                 if (TextEditDoesItNeedToBeSaved(Window->Accent4Edit))
  2117.                     {
  2118.                         StringTemp = TextEditGetRawData(Window->Accent4Edit,SYSTEMLINEFEED);
  2119.                         if (StringTemp == NIL)
  2120.                             {
  2121.                                 ErrorNoMemory = True;
  2122.                             }
  2123.                          else
  2124.                             {
  2125.                                 PutNoteAccent4(Note,StringToLongDouble(StringTemp,PtrSize(StringTemp)));
  2126.                                 ReleasePtr(StringTemp);
  2127.                             }
  2128.                     }
  2129.  
  2130.                 if (TextEditDoesItNeedToBeSaved(Window->PitchDispRateEdit))
  2131.                     {
  2132.                         StringTemp = TextEditGetRawData(Window->PitchDispRateEdit,SYSTEMLINEFEED);
  2133.                         if (StringTemp == NIL)
  2134.                             {
  2135.                                 ErrorNoMemory = True;
  2136.                             }
  2137.                          else
  2138.                             {
  2139.                                 PutNotePitchDisplacementRateAdjust(Note,StringToLongDouble(StringTemp,
  2140.                                     PtrSize(StringTemp)));
  2141.                                 ReleasePtr(StringTemp);
  2142.                             }
  2143.                     }
  2144.  
  2145.                 if (TextEditDoesItNeedToBeSaved(Window->PitchDispDepthEdit))
  2146.                     {
  2147.                         StringTemp = TextEditGetRawData(Window->PitchDispDepthEdit,SYSTEMLINEFEED);
  2148.                         if (StringTemp == NIL)
  2149.                             {
  2150.                                 ErrorNoMemory = True;
  2151.                             }
  2152.                          else
  2153.                             {
  2154.                                 PutNotePitchDisplacementDepthAdjust(Note,StringToLongDouble(StringTemp,
  2155.                                     PtrSize(StringTemp)));
  2156.                                 ReleasePtr(StringTemp);
  2157.                             }
  2158.                     }
  2159.  
  2160.                 if (GetRadioButtonState(Window->PitchDispDepthHertzButton))
  2161.                     {
  2162.                         PutNotePitchDisplacementDepthConversionMode(Note,
  2163.                             ePitchDisplacementDepthModeHertz);
  2164.                     }
  2165.                 else if (GetRadioButtonState(Window->PitchDispDepthHalfStepButton))
  2166.                     {
  2167.                         PutNotePitchDisplacementDepthConversionMode(Note,
  2168.                             ePitchDisplacementDepthModeHalfSteps);
  2169.                     }
  2170.                 else if (GetRadioButtonState(Window->PitchDispDepthDefaultButton))
  2171.                     {
  2172.                         PutNotePitchDisplacementDepthConversionMode(Note,
  2173.                             ePitchDisplacementDepthModeDefault);
  2174.                     }
  2175.                 else
  2176.                     {
  2177.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  pitch disp depth "
  2178.                             "radio buttons are in an inconsistent state"));
  2179.                     }
  2180.  
  2181.                 if (TextEditDoesItNeedToBeSaved(Window->HurryUpEdit))
  2182.                     {
  2183.                         StringTemp = TextEditGetRawData(Window->HurryUpEdit,SYSTEMLINEFEED);
  2184.                         if (StringTemp == NIL)
  2185.                             {
  2186.                                 ErrorNoMemory = True;
  2187.                             }
  2188.                          else
  2189.                             {
  2190.                                 PutNoteHurryUpFactor(Note,StringToLongDouble(StringTemp,
  2191.                                     PtrSize(StringTemp)));
  2192.                                 ReleasePtr(StringTemp);
  2193.                             }
  2194.                     }
  2195.  
  2196.                 if (TextEditDoesItNeedToBeSaved(Window->PitchDispStartEdit))
  2197.                     {
  2198.                         StringTemp = TextEditGetRawData(Window->PitchDispStartEdit,SYSTEMLINEFEED);
  2199.                         if (StringTemp == NIL)
  2200.                             {
  2201.                                 ErrorNoMemory = True;
  2202.                             }
  2203.                          else
  2204.                             {
  2205.                                 PutNotePitchDisplacementStartPoint(Note,StringToLongDouble(StringTemp,
  2206.                                     PtrSize(StringTemp)));
  2207.                                 ReleasePtr(StringTemp);
  2208.                             }
  2209.                     }
  2210.  
  2211.                 if (GetRadioButtonState(Window->PitchDispStartStartButton))
  2212.                     {
  2213.                         PutNotePitchDisplacementStartOrigin(Note,ePitchDisplacementStartFromStart);
  2214.                     }
  2215.                 else if (GetRadioButtonState(Window->PitchDispStartEndButton))
  2216.                     {
  2217.                         PutNotePitchDisplacementStartOrigin(Note,ePitchDisplacementStartFromEnd);
  2218.                     }
  2219.                 else if (GetRadioButtonState(Window->PitchDispStartDefaultButton))
  2220.                     {
  2221.                         PutNotePitchDisplacementStartOrigin(Note,ePitchDisplacementStartFromDefault);
  2222.                     }
  2223.                 else
  2224.                     {
  2225.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  pitch disp origin "
  2226.                             "radio buttons are in an inconsistent state"));
  2227.                     }
  2228.  
  2229.                 if (TextEditDoesItNeedToBeSaved(Window->StereoPosEdit))
  2230.                     {
  2231.                         StringTemp = TextEditGetRawData(Window->StereoPosEdit,SYSTEMLINEFEED);
  2232.                         if (StringTemp == NIL)
  2233.                             {
  2234.                                 ErrorNoMemory = True;
  2235.                             }
  2236.                          else
  2237.                             {
  2238.                                 PutNoteStereoPositioning(Note,StringToLongDouble(StringTemp,
  2239.                                     PtrSize(StringTemp)));
  2240.                                 ReleasePtr(StringTemp);
  2241.                             }
  2242.                     }
  2243.  
  2244.                 if (TextEditDoesItNeedToBeSaved(Window->SurroundPosEdit))
  2245.                     {
  2246.                         StringTemp = TextEditGetRawData(Window->SurroundPosEdit,SYSTEMLINEFEED);
  2247.                         if (StringTemp == NIL)
  2248.                             {
  2249.                                 ErrorNoMemory = True;
  2250.                             }
  2251.                          else
  2252.                             {
  2253.                                 PutNoteSurroundPositioning(Note,StringToLongDouble(StringTemp,
  2254.                                     PtrSize(StringTemp)));
  2255.                                 ReleasePtr(StringTemp);
  2256.                             }
  2257.                     }
  2258.  
  2259.                 if (TextEditDoesItNeedToBeSaved(Window->DetuneEdit))
  2260.                     {
  2261.                         StringTemp = TextEditGetRawData(Window->DetuneEdit,SYSTEMLINEFEED);
  2262.                         if (StringTemp == NIL)
  2263.                             {
  2264.                                 ErrorNoMemory = True;
  2265.                             }
  2266.                          else
  2267.                             {
  2268.                                 PutNoteDetuning(Note,StringToLongDouble(StringTemp,PtrSize(StringTemp)));
  2269.                                 ReleasePtr(StringTemp);
  2270.                             }
  2271.                     }
  2272.  
  2273.                 if (GetRadioButtonState(Window->DetuneHertzButton))
  2274.                     {
  2275.                         PutNoteDetuneConversionMode(Note,eDetuningModeHertz);
  2276.                     }
  2277.                 else if (GetRadioButtonState(Window->DetuneHalfstepButton))
  2278.                     {
  2279.                         PutNoteDetuneConversionMode(Note,eDetuningModeHalfSteps);
  2280.                     }
  2281.                 else if (GetRadioButtonState(Window->DetuneDefaultButton))
  2282.                     {
  2283.                         PutNoteDetuneConversionMode(Note,eDetuningModeDefault);
  2284.                     }
  2285.                 else
  2286.                     {
  2287.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  detune conversion "
  2288.                             "mode radio buttons are in an inconsistent state"));
  2289.                     }
  2290.  
  2291.                 if (TextEditDoesItNeedToBeSaved(Window->DurationEdit))
  2292.                     {
  2293.                         StringTemp = TextEditGetRawData(Window->DurationEdit,SYSTEMLINEFEED);
  2294.                         if (StringTemp == NIL)
  2295.                             {
  2296.                                 ErrorNoMemory = True;
  2297.                             }
  2298.                          else
  2299.                             {
  2300.                                 unsigned long                Duration;
  2301.                                 MyBoolean                        DotFlag;
  2302.                                 unsigned long                Division;
  2303.  
  2304.                                 Duration = GetNoteDuration(Note);
  2305.                                 DotFlag = GetNoteDotStatus(Note);
  2306.                                 Division = GetNoteDurationDivision(Note);
  2307.                                 StringToNumericDuration(StringTemp,&Duration,&DotFlag,&Division);
  2308.                                 PutNoteDuration(Note,Duration);
  2309.                                 PutNoteDotStatus(Note,DotFlag);
  2310.                                 PutNoteDurationDivision(Note,Division);
  2311.                                 ReleasePtr(StringTemp);
  2312.                             }
  2313.                     }
  2314.  
  2315.                 if (TextEditDoesItNeedToBeSaved(Window->DurationAdjustEdit))
  2316.                     {
  2317.                         StringTemp = TextEditGetRawData(Window->DurationAdjustEdit,SYSTEMLINEFEED);
  2318.                         if (StringTemp == NIL)
  2319.                             {
  2320.                                 ErrorNoMemory = True;
  2321.                             }
  2322.                          else
  2323.                             {
  2324.                                 PutNoteDurationAdjust(Note,StringToLongDouble(StringTemp,
  2325.                                     PtrSize(StringTemp)));
  2326.                                 ReleasePtr(StringTemp);
  2327.                             }
  2328.                     }
  2329.  
  2330.                 if (GetRadioButtonState(Window->DurationAdjustAddButton))
  2331.                     {
  2332.                         PutNoteDurationAdjustMode(Note,eDurationAdjustAdditive);
  2333.                     }
  2334.                 else if (GetRadioButtonState(Window->DurationAdjustMultButton))
  2335.                     {
  2336.                         PutNoteDurationAdjustMode(Note,eDurationAdjustMultiplicative);
  2337.                     }
  2338.                 else if (GetRadioButtonState(Window->DurationAdjustDefaultButton))
  2339.                     {
  2340.                         PutNoteDurationAdjustMode(Note,eDurationAdjustDefault);
  2341.                     }
  2342.                 else
  2343.                     {
  2344.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  duration adjust mode "
  2345.                             "radio buttons are in an inconsistent state"));
  2346.                     }
  2347.  
  2348.                 if (TextEditDoesItNeedToBeSaved(Window->RealPitchEdit))
  2349.                     {
  2350.                         StringTemp = TextEditGetRawData(Window->RealPitchEdit,SYSTEMLINEFEED);
  2351.                         if (StringTemp == NIL)
  2352.                             {
  2353.                                 ErrorNoMemory = True;
  2354.                             }
  2355.                          else
  2356.                             {
  2357.                                 short                        PitchValue;
  2358.                                 unsigned long        SharpFlatThing;
  2359.  
  2360.                                 PitchValue = GetNotePitch(Note);
  2361.                                 SharpFlatThing = GetNoteFlatOrSharpStatus(Note);
  2362.                                 StringToNumericPitch(StringTemp,&PitchValue,&SharpFlatThing);
  2363.                                 PutNotePitch(Note,PitchValue);
  2364.                                 PutNoteFlatOrSharpStatus(Note,SharpFlatThing);
  2365.                                 ReleasePtr(StringTemp);
  2366.                             }
  2367.                     }
  2368.  
  2369.                 if (TextEditDoesItNeedToBeSaved(Window->FakePitchEdit))
  2370.                     {
  2371.                         StringTemp = TextEditGetRawData(Window->FakePitchEdit,SYSTEMLINEFEED);
  2372.                         if (StringTemp == NIL)
  2373.                             {
  2374.                                 ErrorNoMemory = True;
  2375.                             }
  2376.                          else
  2377.                             {
  2378.                                 if (IsItInThere(StringTemp,"def"/*ault*/))
  2379.                                     {
  2380.                                         PutNoteMultisampleFalsePitch(Note,-1);
  2381.                                     }
  2382.                                  else
  2383.                                     {
  2384.                                         short                        PitchValue;
  2385.                                         unsigned long        SharpFlatThing;
  2386.  
  2387.                                         PitchValue = GetNotePitch(Note);
  2388.                                         SharpFlatThing = 0;
  2389.                                         StringToNumericPitch(StringTemp,&PitchValue,&SharpFlatThing);
  2390.                                         PutNoteMultisampleFalsePitch(Note,PitchValue);
  2391.                                     }
  2392.                                 ReleasePtr(StringTemp);
  2393.                             }
  2394.                     }
  2395.  
  2396.                 if (TextEditDoesItNeedToBeSaved(Window->PortamentoEdit))
  2397.                     {
  2398.                         StringTemp = TextEditGetRawData(Window->PortamentoEdit,SYSTEMLINEFEED);
  2399.                         if (StringTemp == NIL)
  2400.                             {
  2401.                                 ErrorNoMemory = True;
  2402.                             }
  2403.                          else
  2404.                             {
  2405.                                 PutNotePortamentoDuration(Note,StringToLongDouble(StringTemp,
  2406.                                     PtrSize(StringTemp)));
  2407.                                 ReleasePtr(StringTemp);
  2408.                             }
  2409.                     }
  2410.  
  2411.                 PutNoteIsItARest(Note,GetCheckBoxState(Window->RestBox));
  2412.  
  2413.                 if (GetRadioButtonState(Window->PortaHertzButton))
  2414.                     {
  2415.                         PutNotePortamentoHertzNotHalfstepsFlag(Note,True);
  2416.                     }
  2417.                 else if (GetRadioButtonState(Window->PortaHalfstepButton))
  2418.                     {
  2419.                         PutNotePortamentoHertzNotHalfstepsFlag(Note,False);
  2420.                     }
  2421.                 else
  2422.                     {
  2423.                         EXECUTE(PRERR(AllowResume,"EditNoteParametersDialog:  portamento mode "
  2424.                             "radio buttons are in an inconsistent state"));
  2425.                     }
  2426.  
  2427.                 PutNoteRetriggerEnvelopesOnTieStatus(Note,GetCheckBoxState(Window->RetrigBox));
  2428.  
  2429.                 PutNoteRelease3FromStartInsteadOfEnd(Note,GetCheckBoxState(Window->Release3Box));
  2430.  
  2431.                 if (ErrorNoMemory)
  2432.                     {
  2433.                         AlertHalt("There was not enough memory to save all of the attributes.",NIL);
  2434.                     }
  2435.             }
  2436.  
  2437.         DisposeSimpleButton(Window->OKButton);
  2438.         DisposeSimpleButton(Window->CancelButton);
  2439.         DisposeTextEdit(Window->EarlyLateEdit);
  2440.         DisposeTextEdit(Window->Release1Edit);
  2441.         DisposeRadioButton(Window->Release1StartButton);
  2442.         DisposeRadioButton(Window->Release1EndButton);
  2443.         DisposeRadioButton(Window->Release1DefaultButton);
  2444.         DisposeTextEdit(Window->LoudnessEdit);
  2445.         DisposeTextEdit(Window->Release2Edit);
  2446.         DisposeRadioButton(Window->Release2StartButton);
  2447.         DisposeRadioButton(Window->Release2EndButton);
  2448.         DisposeRadioButton(Window->Release2DefaultButton);
  2449.         DisposeTextEdit(Window->Accent1Edit);
  2450.         DisposeTextEdit(Window->Accent2Edit);
  2451.         DisposeTextEdit(Window->Accent3Edit);
  2452.         DisposeTextEdit(Window->Accent4Edit);
  2453.         DisposeTextEdit(Window->PitchDispRateEdit);
  2454.         DisposeTextEdit(Window->PitchDispDepthEdit);
  2455.         DisposeRadioButton(Window->PitchDispDepthHertzButton);
  2456.         DisposeRadioButton(Window->PitchDispDepthHalfStepButton);
  2457.         DisposeRadioButton(Window->PitchDispDepthDefaultButton);
  2458.         DisposeTextEdit(Window->HurryUpEdit);
  2459.         DisposeTextEdit(Window->PitchDispStartEdit);
  2460.         DisposeRadioButton(Window->PitchDispStartStartButton);
  2461.         DisposeRadioButton(Window->PitchDispStartEndButton);
  2462.         DisposeRadioButton(Window->PitchDispStartDefaultButton);
  2463.         DisposeTextEdit(Window->StereoPosEdit);
  2464.         DisposeTextEdit(Window->DetuneEdit);
  2465.         DisposeRadioButton(Window->DetuneHertzButton);
  2466.         DisposeRadioButton(Window->DetuneHalfstepButton);
  2467.         DisposeRadioButton(Window->DetuneDefaultButton);
  2468.         DisposeTextEdit(Window->SurroundPosEdit);
  2469.         DisposeTextEdit(Window->DurationEdit);
  2470.         DisposeTextEdit(Window->DurationAdjustEdit);
  2471.         DisposeRadioButton(Window->DurationAdjustAddButton);
  2472.         DisposeRadioButton(Window->DurationAdjustMultButton);
  2473.         DisposeRadioButton(Window->DurationAdjustDefaultButton);
  2474.         DisposeTextEdit(Window->RealPitchEdit);
  2475.         DisposeTextEdit(Window->FakePitchEdit);
  2476.         DisposeTextEdit(Window->PortamentoEdit);
  2477.         DisposeCheckBox(Window->RestBox);
  2478.         DisposeRadioButton(Window->PortaHertzButton);
  2479.         DisposeRadioButton(Window->PortaHalfstepButton);
  2480.         DisposeCheckBox(Window->RetrigBox);
  2481.         DisposeCheckBox(Window->Release3Box);
  2482.         KillWindow(Window->ScreenID);
  2483.         ReleasePtr((char*)Window);
  2484.         /* no return value */
  2485.     }
  2486.